test: improve config tests; check only exported funcs#1579
Merged
alexandear merged 1 commit intomgechev:masterfrom Nov 15, 2025
Merged
test: improve config tests; check only exported funcs#1579alexandear merged 1 commit intomgechev:masterfrom
alexandear merged 1 commit intomgechev:masterfrom
Conversation
d89a1ee to
7824898
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the config package tests to use black-box testing (package config_test) to ensure tests only validate exported API surface. The PR also adds test coverage for issue #969 (handling deprecated rule names) and validates error handling for invalid regex patterns in rule exclude configurations.
- Converts white-box tests to black-box tests by renaming package to
config_test - Adds comprehensive test validation for rule enable/disable scenarios
- Adds test coverage for deprecated rule name handling and invalid exclude patterns
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| config/config_test.go | Refactored to use black-box testing with config_test package, expanded test assertions for rule validation, and added new test cases |
| config/testdata/issue-969.toml | Test configuration file for issue #969 testing deprecated rule name imports-blacklist |
| config/testdata/invalidExcludePattern.toml | Test configuration file with invalid regex pattern to verify error handling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7824898 to
0b2af3d
Compare
0b2af3d to
675c418
Compare
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.
This PR:
configpackage toconfig_testinconfig/config_test.goand fixes tests.Updates #1362