Commit a25fbcc
authored
test: add config discovery vs autodiscovery test coverage (#639)
* test: add config discovery vs autodiscovery test coverage
Add 5 comprehensive tests covering the interaction between config file
discovery (walking up directory tree) and autodiscovery mode triggering.
Tests added:
- Subdirectory with parent config (uses config, not autodiscovery)
- Subdirectory with empty parent config (triggers autodiscovery)
- Monorepo with multiple configs (merges configs correctly)
- Autodiscovery only when ALL arrays empty (edge case validation)
- No config anywhere in tree (autodiscovery from any depth)
These tests ensure the monorepo support and autodiscovery behavior
work correctly together, which was previously untested.
* 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.
* chore(test): remove redundant fixture comments
Per coding style guide to avoid commenting obvious operations.
Removed 10 'Use fixture' comments where the fixture usage is
self-explanatory from the getTestDataPath() function calls.
Kept non-obvious comments like the .git runtime creation note
which explains a technical constraint.1 parent 1f00225 commit a25fbcc
File tree
39 files changed
+1067
-599
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
+1067
-599
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