test: add config discovery vs autodiscovery test coverage#639
Merged
Conversation
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.
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.
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.
NoaheCampbell
approved these changes
Oct 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 5 comprehensive integration tests covering the interaction between config file discovery (monorepo support) and autodiscovery mode.
Tests Added
.replicatedconfig instead of autodiscoveryWhy These Tests Matter
These tests ensure the monorepo config merging logic and autodiscovery mode work correctly together. Previously, there were no tests verifying behavior when:
replicated lintfrom a subdirectory with a parent config.replicatedfiles need to be mergedThis gap meant we had no coverage for the
FindAndParseConfig()monorepo support interacting with the autodiscovery logic.