From a0c6a06a9acd697366e13ff31ed61fec17314ef3 Mon Sep 17 00:00:00 2001 From: sheidkamp Date: Fri, 22 Nov 2024 09:16:46 -0500 Subject: [PATCH 1/4] changes --- .../dont-export-split-validation-test.yaml | 8 ++++++++ .../kubernetes/e2e/tests/validation_strict_tests.go | 13 +++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 changelog/v1.18.0-rc2/dont-export-split-validation-test.yaml diff --git a/changelog/v1.18.0-rc2/dont-export-split-validation-test.yaml b/changelog/v1.18.0-rc2/dont-export-split-validation-test.yaml new file mode 100644 index 00000000000..d9f5e64715f --- /dev/null +++ b/changelog/v1.18.0-rc2/dont-export-split-validation-test.yaml @@ -0,0 +1,8 @@ +changelog: + - type: NON_USER_FACING + issueLink: https://github.com/solo-io/solo-projects/issues/7256 + resolvesIssue: false + description: >- + Create a new SuiteRunner for the ValidationTests which does not include the split validation test, which + fails when imported by other projects. https://github.com/k8sgateway/k8sgateway/issues/10374 created to + track a fix that will allow tests that update Helm values to be exported. diff --git a/test/kubernetes/e2e/tests/validation_strict_tests.go b/test/kubernetes/e2e/tests/validation_strict_tests.go index f9b8f846f10..239704eec01 100644 --- a/test/kubernetes/e2e/tests/validation_strict_tests.go +++ b/test/kubernetes/e2e/tests/validation_strict_tests.go @@ -16,3 +16,16 @@ func ValidationStrictSuiteRunner() e2e.SuiteRunner { return validationSuiteRunner } + +// This is a copy of the above function with the "ValidationSplitWebhook" test removed +// The "ValidationSplitWebhook" test has logic that depends on the helm chart/values/helpers +// that are not valid when the project is imported as a helm dependency +// https://github.com/k8sgateway/k8sgateway/issues/10374 has been created to create a fix for this +func ValidationStrictSuiteRunnerForExport() e2e.SuiteRunner { + validationSuiteRunner := e2e.NewSuiteRunner(false) + + validationSuiteRunner.Register("ValidationStrictWarnings", validation_strict_warnings.NewTestingSuite) + validationSuiteRunner.Register("ValidationRejectInvalid", validation_reject_invalid.NewTestingSuite) + + return validationSuiteRunner +} From a910a2822c8c2239aa60d23d0d702f00e1a6bec1 Mon Sep 17 00:00:00 2001 From: sheidkamp Date: Fri, 22 Nov 2024 09:18:41 -0500 Subject: [PATCH 2/4] Update validation_strict_tests.go --- test/kubernetes/e2e/tests/validation_strict_tests.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/kubernetes/e2e/tests/validation_strict_tests.go b/test/kubernetes/e2e/tests/validation_strict_tests.go index 239704eec01..7773d5533c3 100644 --- a/test/kubernetes/e2e/tests/validation_strict_tests.go +++ b/test/kubernetes/e2e/tests/validation_strict_tests.go @@ -8,16 +8,13 @@ import ( ) func ValidationStrictSuiteRunner() e2e.SuiteRunner { - validationSuiteRunner := e2e.NewSuiteRunner(false) - - validationSuiteRunner.Register("ValidationStrictWarnings", validation_strict_warnings.NewTestingSuite) - validationSuiteRunner.Register("ValidationRejectInvalid", validation_reject_invalid.NewTestingSuite) + validationSuiteRunner := ValidationStrictSuiteRunnerForExport() validationSuiteRunner.Register("ValidationSplitWebhook", split_webhook.NewTestingSuite) return validationSuiteRunner } -// This is a copy of the above function with the "ValidationSplitWebhook" test removed +// ValidationStrictSuiteRunnerForExport is used to export the validation tests that can be run when the project is imported as a helm dependency // The "ValidationSplitWebhook" test has logic that depends on the helm chart/values/helpers // that are not valid when the project is imported as a helm dependency // https://github.com/k8sgateway/k8sgateway/issues/10374 has been created to create a fix for this From d92c6cd93036438426b83054d0a2ad972b44e912 Mon Sep 17 00:00:00 2001 From: sheidkamp Date: Fri, 22 Nov 2024 12:04:03 -0500 Subject: [PATCH 3/4] Update validation_strict_tests.go --- test/kubernetes/e2e/tests/validation_strict_tests.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/kubernetes/e2e/tests/validation_strict_tests.go b/test/kubernetes/e2e/tests/validation_strict_tests.go index 7773d5533c3..822f359df88 100644 --- a/test/kubernetes/e2e/tests/validation_strict_tests.go +++ b/test/kubernetes/e2e/tests/validation_strict_tests.go @@ -17,7 +17,8 @@ func ValidationStrictSuiteRunner() e2e.SuiteRunner { // ValidationStrictSuiteRunnerForExport is used to export the validation tests that can be run when the project is imported as a helm dependency // The "ValidationSplitWebhook" test has logic that depends on the helm chart/values/helpers // that are not valid when the project is imported as a helm dependency -// https://github.com/k8sgateway/k8sgateway/issues/10374 has been created to create a fix for this +// https://github.com/k8sgateway/k8sgateway/issues/10374 has been created to create a fix for this. +// If more tests are added that depend on the helm chart/values/helpers, the above issue should be resolved instead of using this approach func ValidationStrictSuiteRunnerForExport() e2e.SuiteRunner { validationSuiteRunner := e2e.NewSuiteRunner(false) From 485aa038fab9bdc2a87159a330d097a5a01b4ab2 Mon Sep 17 00:00:00 2001 From: sheidkamp Date: Fri, 22 Nov 2024 16:48:56 -0500 Subject: [PATCH 4/4] Update test naming so dependencies don't need to change --- test/kubernetes/e2e/tests/validation_strict_test.go | 2 +- test/kubernetes/e2e/tests/validation_strict_tests.go | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/test/kubernetes/e2e/tests/validation_strict_test.go b/test/kubernetes/e2e/tests/validation_strict_test.go index 975893c9f09..97d95f8b783 100644 --- a/test/kubernetes/e2e/tests/validation_strict_test.go +++ b/test/kubernetes/e2e/tests/validation_strict_test.go @@ -50,5 +50,5 @@ func TestValidationStrict(t *testing.T) { // Install Gloo Gateway with correct validation settings testInstallation.InstallGlooGatewayWithTestHelper(ctx, testHelper, 5*time.Minute) - ValidationStrictSuiteRunner().Run(ctx, t, testInstallation) + ValidationStrictSuiteRunnerAll().Run(ctx, t, testInstallation) } diff --git a/test/kubernetes/e2e/tests/validation_strict_tests.go b/test/kubernetes/e2e/tests/validation_strict_tests.go index 822f359df88..63bcb005674 100644 --- a/test/kubernetes/e2e/tests/validation_strict_tests.go +++ b/test/kubernetes/e2e/tests/validation_strict_tests.go @@ -7,19 +7,21 @@ import ( "github.com/solo-io/gloo/test/kubernetes/e2e/features/validation/validation_strict_warnings" ) -func ValidationStrictSuiteRunner() e2e.SuiteRunner { - validationSuiteRunner := ValidationStrictSuiteRunnerForExport() +// ValidationStrictSuiteRunnerAll is used to run all the validation tests, including ones that depend on the helm chart/values/helpers +// This is the function that should be used to run the validation tests in this repo +func ValidationStrictSuiteRunnerAll() e2e.SuiteRunner { + validationSuiteRunner := ValidationStrictSuiteRunner() validationSuiteRunner.Register("ValidationSplitWebhook", split_webhook.NewTestingSuite) return validationSuiteRunner } -// ValidationStrictSuiteRunnerForExport is used to export the validation tests that can be run when the project is imported as a helm dependency +// ValidationStrictSuiteRunner is used to export the validation tests that can be run when the project is imported as a helm dependency // The "ValidationSplitWebhook" test has logic that depends on the helm chart/values/helpers // that are not valid when the project is imported as a helm dependency // https://github.com/k8sgateway/k8sgateway/issues/10374 has been created to create a fix for this. // If more tests are added that depend on the helm chart/values/helpers, the above issue should be resolved instead of using this approach -func ValidationStrictSuiteRunnerForExport() e2e.SuiteRunner { +func ValidationStrictSuiteRunner() e2e.SuiteRunner { validationSuiteRunner := e2e.NewSuiteRunner(false) validationSuiteRunner.Register("ValidationStrictWarnings", validation_strict_warnings.NewTestingSuite)