From 4a58d519c057ae13ded02023ddc0c7fccbde3a5c Mon Sep 17 00:00:00 2001 From: Soumik Majumder Date: Wed, 23 Aug 2023 12:40:50 +0530 Subject: [PATCH] Make --build-values test stricter Signed-off-by: Soumik Majumder --- cli/test/e2e/build_values_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cli/test/e2e/build_values_test.go b/cli/test/e2e/build_values_test.go index 5c191fdf9..3957fbd0e 100644 --- a/cli/test/e2e/build_values_test.go +++ b/cli/test/e2e/build_values_test.go @@ -160,6 +160,13 @@ namespace: test // Verify that validation checks are not performed while running ytt to build packages kappCtrl.RunWithOpts([]string{"package", "release", "--chdir", workingDir, "--build-values", "build-values.yml"}, RunOpts{NoNamespace: true}) + + // Ensure that flag does not affect package output + packageFile, err := os.ReadFile(path.Join(workingDir, "carvel-artifacts", "packages", "samplepackage.corp.com", "package.yml")) + if err != nil { + t.Fatal(err) + } + require.NotContains(t, string(packageFile), "valuesFrom") }) } @@ -313,5 +320,12 @@ fooVal: bar t.Fatal(err) } kappCtrl.RunWithOpts([]string{"package", "release", "--chdir", workingDir, "--build-values", "build-values.yml"}, RunOpts{NoNamespace: true}) + + // Ensure that flag does not affect package output + packageFile, err := os.ReadFile(path.Join(workingDir, "carvel-artifacts", "packages", "samplepackage.corp.com", "package.yml")) + if err != nil { + t.Fatal(err) + } + require.NotContains(t, string(packageFile), "valuesFrom") }) }