Reach 100% code coverage with minimal test additions#36
Merged
Conversation
Co-authored-by: GrantBirki <23362539+GrantBirki@users.noreply.github.com>
Co-authored-by: GrantBirki <23362539+GrantBirki@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] task: reach 100% code coverage
Reach 100% code coverage with minimal test additions
Jun 12, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR raises the coverage threshold to 100% and adds targeted unit tests to cover three previously untested code paths without modifying production code.
- Updated the required coverage percentage to 100%
- Added boolean-environment-variable tests for
ConfigLoader - Added parsing test for space-separated UTC timestamps in
TimestampValidator - Added a test to access the global logger in the
Lifecycleplugin
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| spec/unit/required_coverage_percentage.rb | Bumped coverage threshold from 99% to 100% |
| spec/unit/lib/hooks/core/config_loader_spec.rb | New test for boolean ENV var conversion |
| spec/unit/lib/hooks/plugins/auth/timestamp_validator_spec.rb | New test for space-separated UTC timestamp parsing |
| spec/unit/lib/hooks/plugins/lifecycle_spec.rb | New test for #log accessor to global logger |
| .bundle/config | Updated bundle path and enabled deployment mode |
Comments suppressed due to low confidence (1)
.bundle/config:3
- Changes to
.bundle/configare typically local to a developer’s machine and shouldn’t be committed. Consider removing this file from version control or restoring its original settings.
BUNDLE_PATH: "/home/runner/work/hooks/hooks/vendor/bundle"
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 achieves 100% code coverage by adding focused tests for the three remaining uncovered lines identified in the codebase.
Changes Made
Test Coverage Additions
HOOKS_USE_CATCHALL_ROUTE,HOOKS_SYMBOLIZE_PAYLOAD,HOOKS_NORMALIZE_HEADERS)"2025-06-12 10:30:00 +0000")logmethod accessor to ensure global logger access is coveredCoverage Requirement Update
spec/unit/required_coverage_percentage.rbfrom 99% to 100%Results
Minimal Impact
The changes are surgical and focused:
Fixes #35.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.