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 <aiopsclub@163.com>
This commit is contained in:
yxxhero 2026-01-23 17:13:31 +08:00 committed by yxxhero
parent 8c64467909
commit 3f4088a821
6 changed files with 5 additions and 34 deletions

View File

@ -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
---

View File

@ -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
---

View File

@ -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
---

View File

@ -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

View File

@ -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

View File

@ -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
---