diff --git a/tests/framework/ngf.go b/tests/framework/ngf.go index 4f754fb894..64eb23be25 100644 --- a/tests/framework/ngf.go +++ b/tests/framework/ngf.go @@ -56,31 +56,6 @@ func UninstallGatewayAPI(apiVersion string) ([]byte, error) { return nil, nil } -// InstallNGFDebugLevel installs NGF with debug log level. -func InstallNGFDebugLevel(cfg InstallationConfig, extraArgs ...string) ([]byte, error) { - args := []string{ - "install", - "--debug", - cfg.ReleaseName, - cfg.ChartPath, - "--create-namespace", - "--namespace", cfg.Namespace, - "--wait", - "--set", "nginxGateway.productTelemetry.enable=false", - "--set", "nginxGateway.config.logging.level=debug", - } - if cfg.ChartVersion != "" { - args = append(args, "--version", cfg.ChartVersion) - } - - args = append(args, setImageArgs(cfg)...) - fullArgs := append(args, extraArgs...) - - GinkgoWriter.Printf("Installing NGF with command: helm %v\n", strings.Join(fullArgs, " ")) - - return exec.Command("helm", fullArgs...).CombinedOutput() -} - // InstallNGF installs NGF. func InstallNGF(cfg InstallationConfig, extraArgs ...string) ([]byte, error) { args := []string{ diff --git a/tests/suite/nginxgateway_test.go b/tests/suite/nginxgateway_test.go index 3311ab3a12..d75ae06877 100644 --- a/tests/suite/nginxgateway_test.go +++ b/tests/suite/nginxgateway_test.go @@ -126,7 +126,7 @@ var _ = Describe("NginxGateway", Ordered, Label("functional", "nginxGateway"), f teardown(releaseName) cfg := getDefaultSetupCfg() - cfg.infoLogLevel = true + cfg.debugLogLevel = false setup(cfg) ngfPodName, err := getNGFPodName() diff --git a/tests/suite/system_suite_test.go b/tests/suite/system_suite_test.go index 0d8db5211c..e70d6ab9db 100644 --- a/tests/suite/system_suite_test.go +++ b/tests/suite/system_suite_test.go @@ -91,12 +91,12 @@ const ( ) type setupConfig struct { - releaseName string - chartPath string - gwAPIVersion string - deploy bool - nfr bool - infoLogLevel bool + releaseName string + chartPath string + gwAPIVersion string + deploy bool + nfr bool + debugLogLevel bool } func setup(cfg setupConfig, extraInstallArgs ...string) { @@ -213,14 +213,16 @@ func setupNGF(cfg setupConfig, extraInstallArgs ...string) framework.Installatio output, err := framework.InstallGatewayAPI(cfg.gwAPIVersion) Expect(err).ToNot(HaveOccurred(), string(output)) - if cfg.infoLogLevel { - output, err = framework.InstallNGF(installCfg, extraInstallArgs...) - Expect(err).ToNot(HaveOccurred(), string(output)) - } else { - output, err = framework.InstallNGFDebugLevel(installCfg, extraInstallArgs...) - Expect(err).ToNot(HaveOccurred(), string(output)) + if cfg.debugLogLevel { + extraInstallArgs = append( + extraInstallArgs, + "--set", "nginxGateway.config.logging.level=debug", + ) } + output, err = framework.InstallNGF(installCfg, extraInstallArgs...) + Expect(err).ToNot(HaveOccurred(), string(output)) + return installCfg } @@ -267,10 +269,11 @@ func getDefaultSetupCfg() setupConfig { localChartPath = filepath.Join(basepath, "charts/nginx-gateway-fabric") return setupConfig{ - releaseName: releaseName, - chartPath: localChartPath, - gwAPIVersion: *gatewayAPIVersion, - deploy: true, + releaseName: releaseName, + chartPath: localChartPath, + gwAPIVersion: *gatewayAPIVersion, + deploy: true, + debugLogLevel: true, } } diff --git a/tests/suite/upgrade_test.go b/tests/suite/upgrade_test.go index e4b1f1aa7f..0ca7923872 100644 --- a/tests/suite/upgrade_test.go +++ b/tests/suite/upgrade_test.go @@ -48,11 +48,12 @@ var _ = Describe("Upgrade testing", Label("nfr", "upgrade"), func() { teardown(releaseName) cfg := setupConfig{ - releaseName: releaseName, - chartPath: "oci://ghcr.io/nginxinc/charts/nginx-gateway-fabric", - gwAPIVersion: *gatewayAPIPrevVersion, - deploy: true, - nfr: true, + releaseName: releaseName, + chartPath: "oci://ghcr.io/nginxinc/charts/nginx-gateway-fabric", + gwAPIVersion: *gatewayAPIPrevVersion, + deploy: true, + nfr: true, + debugLogLevel: true, } setup(cfg, "--values", valuesFile)