Skip to content

test: improve config tests; check only exported funcs#1579

Merged
alexandear merged 1 commit intomgechev:masterfrom
alexandear:test/config
Nov 15, 2025
Merged

test: improve config tests; check only exported funcs#1579
alexandear merged 1 commit intomgechev:masterfrom
alexandear:test/config

Conversation

@alexandear
Copy link
Copy Markdown
Collaborator

@alexandear alexandear commented Nov 15, 2025

This PR:

  1. Adds the test cases for issue fix 968 by removing references to black and white lists #969, an invalid rule excludes pattern, non-defaults config rules.
  2. Renames config package to config_test in config/config_test.go and fixes tests.

Updates #1362

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@alexandear alexandear changed the title test: check only exported functions in config package test: improves config tests; check only exported funcs Nov 15, 2025
@alexandear alexandear changed the title test: improves config tests; check only exported funcs test: improve config tests; check only exported funcs Nov 15, 2025
@alexandear alexandear merged commit 6ff1fc5 into mgechev:master Nov 15, 2025
10 checks passed
@alexandear alexandear deleted the test/config branch November 15, 2025 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants