Skip to content

Add CEL validation tests for NginxProxy #3701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Aug 13, 2025
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
9631d54
Add tests for kubernetes validation
shaun-nx Aug 7, 2025
8455a14
Add tests for rewriteClientIP
shaun-nx Aug 7, 2025
8404b7d
Move validation function to common.go
shaun-nx Aug 7, 2025
0ba4b7c
Add comment to `validateCrd` function
shaun-nx Aug 7, 2025
8032352
Merge branch 'main' into tests/cel-nginxproxy
shaun-nx Aug 7, 2025
82f84a1
Merge branch 'main' into tests/cel-nginxproxy
shaun-nx Aug 11, 2025
b1da498
Move expected error strings to common.go
shaun-nx Aug 11, 2025
80e121a
Add tests for autoscaling validation
shaun-nx Aug 11, 2025
9bbe4cd
Refactor tests
shaun-nx Aug 11, 2025
8612c21
Change name of `testResourceName` const
shaun-nx Aug 11, 2025
45302dc
Group expexted error consts
shaun-nx Aug 11, 2025
9bb4bdb
Ensure gateway CRDs are installed when running `test-cel-validation`
shaun-nx Aug 11, 2025
531850d
Undo changes to `install-gateway-crds` command
shaun-nx Aug 11, 2025
d742467
Change `policyName` to `resourceName`
shaun-nx Aug 11, 2025
216406c
Add test for when `minReplicas` is nil
shaun-nx Aug 12, 2025
702ccb5
Merge branch 'main' into tests/cel-nginxproxy
shaun-nx Aug 12, 2025
960db80
Have `k8sClient.Delete` use same context and `k8sClient.Create`
shaun-nx Aug 12, 2025
38e20ee
Add spacing
shaun-nx Aug 12, 2025
aba710a
Add additional comments
shaun-nx Aug 12, 2025
14ee3f7
Ensure installed resources are only delete if an error is NOT expected
shaun-nx Aug 12, 2025
ac12bab
Expected k8sClient.Delete to succeed
shaun-nx Aug 12, 2025
55d4fe1
Merge branch 'main' into tests/cel-nginxproxy
shaun-nx Aug 13, 2025
51d49f8
Add additional comments
shaun-nx Aug 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tests/cel/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,17 @@ func uniqueResourceName(name string) string {
func validateCrd(t *testing.T, wantErrors []string, crd client.Object, k8sClient client.Client) {
t.Helper()
g := NewWithT(t)
var deleteErr error
timeoutConfig := framework.DefaultTimeoutConfig()
ctx, cancel := context.WithTimeout(context.Background(), timeoutConfig.KubernetesClientTimeout)
defer cancel()
err := k8sClient.Create(ctx, crd)

// Clean up after test
defer func() {
_ = k8sClient.Delete(context.Background(), crd)
deleteErr = k8sClient.Delete(ctx, crd)
}()

g.Expect(deleteErr).ToNot(HaveOccurred())
if len(wantErrors) == 0 {
g.Expect(err).ToNot(HaveOccurred())
} else {
Expand Down
Loading