mirror of
https://github.com/helm/helm.git
synced 2026-04-15 21:59:50 -04:00
The `TestValidateChartIconPresence` test fails when run after
`TestValidateChartIconURL` as they both are using a global
variable `badChart.Icon`
```
: go test -v -test.shuffle 1 -run '^(TestValidateChartIconPresence|TestValidateChartIconURL)$' ./pkg/lint/rules/
-test.shuffle 1
=== RUN TestValidateChartIconURL
--- PASS: TestValidateChartIconURL (0.00s)
=== RUN TestValidateChartIconPresence
chartfile_test.go:171: validateChartIconPresence to return a linter error, got no error
--- FAIL: TestValidateChartIconPresence (0.00s)
FAIL
FAIL helm.sh/helm/v4/pkg/lint/rules 0.051s
FAIL
: go test -v -test.shuffle 2 -run '^(TestValidateChartIconPresence|TestValidateChartIconURL)$' ./pkg/lint/rules/
-test.shuffle 2
=== RUN TestValidateChartIconPresence
--- PASS: TestValidateChartIconPresence (0.00s)
=== RUN TestValidateChartIconURL
--- PASS: TestValidateChartIconURL (0.00s)
PASS
ok helm.sh/helm/v4/pkg/lint/rules 0.050s
```
This commit:
1. Remove dependency on global variable
2. Explicitly set the state of the test object.
Signed-off-by: Rostyslav Polishchuk <rostyslavp@google.com>
|
||
|---|---|---|
| .. | ||
| action | ||
| chart/v2 | ||
| cli | ||
| cmd | ||
| downloader | ||
| engine | ||
| gates | ||
| getter | ||
| helmpath | ||
| ignore | ||
| kube | ||
| lint | ||
| plugin | ||
| postrender | ||
| provenance | ||
| pusher | ||
| registry | ||
| release | ||
| repo | ||
| storage | ||
| strvals | ||
| time | ||
| uploader | ||