Commit 972200d
committed
refactor(test): migrate lint tests to use reusable fixtures
Migrates 10 test functions in lint_test.go to use testdata fixtures
instead of inline file creation, following the pattern established
in image_extraction_test.go.
Changes:
- Add helper functions: getTestDataPath, copyFixtureToTemp
- Create testdata/lint/ with 39 fixture files across 8 scenarios
- Migrate tests: TestLint_VerboseFlag, TestLint_ChartValidationError,
TestLint_AutodiscoveryWithMixedManifests, and 7 others
- Reduce test file: 2,355 → 1,888 lines (20% reduction)
- Reduce os.WriteFile calls: 74 → 42 (43% reduction)
Fixtures created:
- simple-chart/ - Basic chart for simple tests
- multi-chart-project/ - Multiple charts scenario
- chart-missing-helmchart/ - Validation error tests
- orphaned-helmchart/ - Validation warning tests
- mixed-manifests-autodiscovery/ - Mixed resource types
- mixed-manifests-yaml-yml/ - Mixed file extensions (.yaml/.yml)
- hidden-dirs-test/ - Hidden directory testing (.github)
- configs/ - 6 reusable config templates
Remaining inline tests use dynamic paths, test error scenarios,
or are minimal configs where fixtures would add overhead.
All tests pass.1 parent c577b61 commit 972200d
File tree
39 files changed
+427
-584
lines changed- cli/cmd
- testdata/lint
- chart-missing-helmchart
- chart
- manifests
- configs
- mixed-manifests-autodiscovery
- charts/my-chart
- manifests
- mixed-manifests-yaml-yml
- charts/my-chart
- manifests
- multi-chart-project
- chart1
- templates
- chart2
- templates
- manifests
- orphaned-helmchart
- chart
- manifests
- simple-chart
- chart
- templates
- manifests
39 files changed
+427
-584
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments