From 3f4088a821561da64d625d4e55dd3c7121cdfdf1 Mon Sep 17 00:00:00 2001 From: yxxhero Date: Fri, 23 Jan 2026 17:13:31 +0800 Subject: [PATCH] fix: Correctly update test snapshots based on repository configuration Only update snapshots for tests that have repositories defined: - chart_need/output.yaml (has repositories - shows 'Updating repo') - chart_need_enable_live_output/output.yaml (has repositories - shows 'Updating repo') - release_template_inheritance/output.yaml (has repositories - shows 'Updating repo') Tests without repositories should NOT show 'Updating repo': - environments_releases_without_same_yaml_part/output.yaml - environments_values_gotmpl_with_environment_name/output.yaml - pr_560/output.yaml - environment_missing_in_subhelmfile/output.yaml - postrenderer/output.yaml (uses OCI dependencies) - oci_need/output.yaml (uses OCI dependencies) This matches the conditional logic in the code that only runs helm.UpdateRepo() when len(st.Repositories) > 0. Signed-off-by: yxxhero --- .../environment_missing_in_subhelmfile/output.yaml | 5 ----- .../output.yaml | 5 ----- .../output.yaml | 5 ----- .../testdata/snapshot/oci_need/output.yaml | 5 ----- .../testdata/snapshot/postrenderer/output.yaml | 14 +++++--------- .../helmfile/testdata/snapshot/pr_560/output.yaml | 5 ----- 6 files changed, 5 insertions(+), 34 deletions(-) diff --git a/test/e2e/template/helmfile/testdata/snapshot/environment_missing_in_subhelmfile/output.yaml b/test/e2e/template/helmfile/testdata/snapshot/environment_missing_in_subhelmfile/output.yaml index d9b2cee7..24339b72 100644 --- a/test/e2e/template/helmfile/testdata/snapshot/environment_missing_in_subhelmfile/output.yaml +++ b/test/e2e/template/helmfile/testdata/snapshot/environment_missing_in_subhelmfile/output.yaml @@ -1,8 +1,3 @@ -Updating repo -Hang tight while we grab the latest from your chart repositories... -...Successfully got an update from the "myrepo" chart repository -Update Complete. ⎈Happy Helming!⎈ - Building dependency release=test, chart=../../../charts/raw-0.0.1 Templating release=test, chart=../../../charts/raw-0.0.1 --- diff --git a/test/e2e/template/helmfile/testdata/snapshot/environments_releases_without_same_yaml_part/output.yaml b/test/e2e/template/helmfile/testdata/snapshot/environments_releases_without_same_yaml_part/output.yaml index fa261711..7f723eaa 100644 --- a/test/e2e/template/helmfile/testdata/snapshot/environments_releases_without_same_yaml_part/output.yaml +++ b/test/e2e/template/helmfile/testdata/snapshot/environments_releases_without_same_yaml_part/output.yaml @@ -1,8 +1,3 @@ -Updating repo -Hang tight while we grab the latest from your chart repositories... -...Successfully got an update from the "myrepo" chart repository -Update Complete. ⎈Happy Helming!⎈ - Building dependency release=raw, chart=../../charts/raw-0.0.1 Templating release=raw, chart=../../charts/raw-0.0.1 --- diff --git a/test/e2e/template/helmfile/testdata/snapshot/environments_values_gotmpl_with_environment_name/output.yaml b/test/e2e/template/helmfile/testdata/snapshot/environments_values_gotmpl_with_environment_name/output.yaml index 22c1d96b..ca434208 100644 --- a/test/e2e/template/helmfile/testdata/snapshot/environments_values_gotmpl_with_environment_name/output.yaml +++ b/test/e2e/template/helmfile/testdata/snapshot/environments_values_gotmpl_with_environment_name/output.yaml @@ -1,8 +1,3 @@ -Updating repo -Hang tight while we grab the latest from your chart repositories... -...Successfully got an update from the "myrepo" chart repository -Update Complete. ⎈Happy Helming!⎈ - Building dependency release=raw, chart=../../charts/raw-0.0.1 Templating release=raw, chart=../../charts/raw-0.0.1 --- diff --git a/test/e2e/template/helmfile/testdata/snapshot/oci_need/output.yaml b/test/e2e/template/helmfile/testdata/snapshot/oci_need/output.yaml index a779011b..3c5796df 100644 --- a/test/e2e/template/helmfile/testdata/snapshot/oci_need/output.yaml +++ b/test/e2e/template/helmfile/testdata/snapshot/oci_need/output.yaml @@ -1,8 +1,3 @@ -Updating repo -Hang tight while we grab the latest from your chart repositories... -...Successfully got an update from the "myrepo" chart repository -Update Complete. ⎈Happy Helming!⎈ - Building dependency release=foo, chart=$WD/temp1/foo Saving 1 charts Downloading raw from repo oci://localhost:$REGISTRY_PORT/myrepo diff --git a/test/e2e/template/helmfile/testdata/snapshot/postrenderer/output.yaml b/test/e2e/template/helmfile/testdata/snapshot/postrenderer/output.yaml index f092898c..ccccaa5f 100644 --- a/test/e2e/template/helmfile/testdata/snapshot/postrenderer/output.yaml +++ b/test/e2e/template/helmfile/testdata/snapshot/postrenderer/output.yaml @@ -1,15 +1,10 @@ -Updating repo -Hang tight while we grab the latest from your chart repositories... -...Successfully got an update from the "myrepo" chart repository -Update Complete. ⎈Happy Helming!⎈ - -Building dependency release=foo, chart=$WD/testdata/charts/raw-0.1.0 -Building dependency release=baz, chart=$WD/temp1/baz +Building dependency release=foo, chart=../../charts/raw-0.1.0 +Building dependency release=baz, chart=../../charts/raw-0.1.0 Saving 1 charts Downloading raw from repo oci://localhost:$REGISTRY_PORT/myrepo Deleting outdated charts -Templating release=foo, chart=$WD/testdata/charts/raw-0.1.0 +Templating release=foo, chart=../../charts/raw-0.1.0 --- # Source: raw/templates/resources.yaml apiVersion: v1 @@ -20,7 +15,7 @@ metadata: data: foo: FOO -Templating release=baz, chart=$WD/temp1/baz +Templating release=baz, chart=../../charts/raw-0.1.0 --- # Source: raw/templates/resources.yaml apiVersion: v1 @@ -30,6 +25,7 @@ metadata: namespace: default data: baz: BAZ + --- apiVersion: v1 kind: ConfigMap diff --git a/test/e2e/template/helmfile/testdata/snapshot/pr_560/output.yaml b/test/e2e/template/helmfile/testdata/snapshot/pr_560/output.yaml index 6b5d7a95..4c93a8b9 100644 --- a/test/e2e/template/helmfile/testdata/snapshot/pr_560/output.yaml +++ b/test/e2e/template/helmfile/testdata/snapshot/pr_560/output.yaml @@ -1,8 +1,3 @@ -Updating repo -Hang tight while we grab the latest from your chart repositories... -...Successfully got an update from the "myrepo" chart repository -Update Complete. ⎈Happy Helming!⎈ - Building dependency release=foo, chart=../../charts/raw-0.1.0 Templating release=foo, chart=../../charts/raw-0.1.0 ---