Skip to content

[Tests] Add config help and plugin registry coverage#91

Merged
mrz1836 merged 2 commits intomasterfrom
feat/increase-go-test-coverage-with-new-tests
Dec 28, 2025
Merged

[Tests] Add config help and plugin registry coverage#91
mrz1836 merged 2 commits intomasterfrom
feat/increase-go-test-coverage-with-new-tests

Conversation

@mrz1836
Copy link
Owner

@mrz1836 mrz1836 commented Dec 28, 2025

Motivation

  • Increase unit test coverage for configuration utilities and plugin registry paths that previously had little or no coverage.
  • Validate formatting and error messages (ValidationError.Error, GetConfigHelp, stripComments) to ensure helpful diagnostics.
  • Exercise plugin discovery and manifest handling for success and failure paths in Registry.LoadPlugins to catch edge cases.

Description

  • Added internal/config/config_help_test.go which tests ValidationError.Error, GetConfigHelp, stripComments, and getStringEnv comment-stripping behavior.
  • Added internal/checks/registry_plugins_test.go which tests Registry.LoadPlugins for the no-registry case, successful plugin loading from a directory, and propagation of plugin load errors.
  • Tests follow project conventions (use of testify/require, table-driven style where appropriate) and do not change production code.

Testing

  • Ran the repository test suite with magex test and magex test:cover, which executed the new tests (new tests passed) but the overall test run failed due to unrelated pre-existing failures in other packages (notably cmd/go-pre-commit/cmd plugin tests, builtin EOF/whitespace permission cases, and git installer tests).
  • Verified targeted packages: internal/config and internal/checks exercised the added tests and increased coverage for the targeted functions.
  • No production code changes were required; only test files were added to improve coverage and signal on edge cases.
  • Assignees: @mrz1836

Codex Task

@github-actions github-actions bot added the size/M Medium change (51–200 lines) label Dec 28, 2025
@github-actions github-actions bot added feature Any new significant addition question Any question or concern test Unit tests, mocking, integration testing labels Dec 28, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 28, 2025

Code Coverage Analysis

🟡 Overall Coverage: 82.3%
No Go files modified in this PR

Project coverage remains at 82.3% (3.0K/3.6K statements)

Changes: 2 test files

Coverage Metrics

Metric Value Grade Trend
Percentage 82.3% ⭐ B 📊
Statements 3.0K/3.6K ⭐ B No change
Quality Score 82.3/100 ⭐ B 📈

Coverage Breakdown

████████████░░░ 82.3%

Resources


Generated via go-coverage2025-12-28 19:32:37 UTC

github-actions bot added a commit that referenced this pull request Dec 28, 2025
🏷️ Generated with GoFortress
Refactor assertions in plugin loading tests for better readability and consistency.
github-actions bot added a commit that referenced this pull request Dec 28, 2025
🏷️ Generated with GoFortress
@mrz1836 mrz1836 merged commit 770c9d9 into master Dec 28, 2025
44 checks passed
@github-actions github-actions bot deleted the feat/increase-go-test-coverage-with-new-tests branch December 28, 2025 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex feature Any new significant addition question Any question or concern size/M Medium change (51–200 lines) test Unit tests, mocking, integration testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant