From 9596790a51f9a2c32b66c44cd8b9850c4aa2d7ef Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Sun, 22 Oct 2023 18:51:40 -0300 Subject: [PATCH] test: fix running tests locally (#1088) --- test/e2e/template/helmfile/snapshot_test.go | 3 ++- .../snapshot/issue_2098_release_template_needs/output.yaml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/e2e/template/helmfile/snapshot_test.go b/test/e2e/template/helmfile/snapshot_test.go index e775d4c0..672598f1 100644 --- a/test/e2e/template/helmfile/snapshot_test.go +++ b/test/e2e/template/helmfile/snapshot_test.go @@ -295,8 +295,9 @@ func testHelmfileTemplateWithBuildCommand(t *testing.T, goccyGoYaml bool) { if stat, _ := os.Stat(outputFile); stat != nil { want, err := os.ReadFile(outputFile) + wantStr := strings.ReplaceAll(string(want), "__workingdir__", wd) require.NoError(t, err) - require.Equal(t, string(want), gotStr) + require.Equal(t, wantStr, gotStr) } else { // To update the test golden image(output.yaml), just remove it and rerun this test. // We automatically capture the output to `output.yaml` in the test case directory diff --git a/test/e2e/template/helmfile/testdata/snapshot/issue_2098_release_template_needs/output.yaml b/test/e2e/template/helmfile/testdata/snapshot/issue_2098_release_template_needs/output.yaml index 97d3f08a..9e3dec93 100644 --- a/test/e2e/template/helmfile/testdata/snapshot/issue_2098_release_template_needs/output.yaml +++ b/test/e2e/template/helmfile/testdata/snapshot/issue_2098_release_template_needs/output.yaml @@ -1,5 +1,5 @@ --- -# Source: /home/runner/work/helmfile/helmfile/test/e2e/template/helmfile/testdata/snapshot/issue_2098_release_template_needs/input.yaml +# Source: __workingdir__/testdata/snapshot/issue_2098_release_template_needs/input.yaml filepath: input.yaml helmBinary: helm