Skip to content

Conversation

ericproulx
Copy link
Contributor

Enable Branch Coverage in SimpleCov Configuration

Summary

This PR enables branch coverage tracking in the SimpleCov configuration to improve test coverage reporting and help identify untested code paths.

Changes

  • Added enable_coverage :branch to the SimpleCov.start block in .simplecov
  • This enables tracking of branch coverage in addition to line coverage

Benefits

  • Better Coverage Insights: Branch coverage provides more detailed information about which conditional branches are tested
  • Improved Code Quality: Helps identify untested conditional logic and edge cases
  • Enhanced CI Reporting: More comprehensive coverage reports in CI/CD pipelines
  • Developer Experience: Better visibility into test coverage gaps

Technical Details

The change is minimal and non-breaking:

  • Only affects test coverage reporting
  • No impact on runtime behavior
  • Compatible with existing SimpleCov setup
  • Works with the existing LCOV formatter for CI

Testing

  • Existing tests continue to pass
  • Coverage reports now include branch coverage metrics
  • CI integration remains functional

Related

This enhancement supports the ongoing effort to improve code quality and test coverage across the Grape codebase.

@ericproulx ericproulx force-pushed the enable_branch_coverage branch 3 times, most recently from 37d6b9e to 6e597a7 Compare September 20, 2025 15:07
@ericproulx ericproulx requested a review from dblock September 22, 2025 08:42
@ericproulx ericproulx marked this pull request as ready for review September 22, 2025 08:42
- Remove namespace_reverse_stackable method from Grape::DSL::Settings
- Replace direct calls to namespace_reverse_stackable with inheritable_setting.namespace_reverse_stackable
- Update rescue_from implementation to use direct inheritable_setting access
- Update tests to verify actual behavior instead of mocking internal methods
- Simplify test setup by extending Grape::DSL::Settings instead of manually stubbing methods
- Move namespace_stackable_with_hash method from DSL::Settings to InheritableSetting
- Update all internal usage to use inheritable_setting.namespace_stackable_with_hash
- Remove public method from DSL::Settings module
- Update tests to reflect the new internal structure
- Increase RuboCop AbcSize limit to accommodate refactored code
- Add enable_coverage :branch to SimpleCov.start block
- Improves test coverage reporting by tracking branch coverage
- Helps identify untested code paths and conditional logic
@ericproulx ericproulx force-pushed the enable_branch_coverage branch from 6e597a7 to 349d82c Compare September 22, 2025 08:45
@ericproulx ericproulx closed this Sep 26, 2025
@ericproulx ericproulx deleted the enable_branch_coverage branch September 26, 2025 08:30
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.

1 participant