Skip to content

Conversation

@omargallob
Copy link

@omargallob omargallob commented Dec 28, 2025

📚 Description

Enable coverage tracking inside lifecycle hooks (set_up, tear_down, set_up_before_script, tear_down_after_script) so that code executed during test setup/teardown is properly attributed in coverage reports.

🔖 Changes

  • Enable coverage trap inside execute_file_hook and execute_test_hook in runner.sh
  • Add fallback to src/ when auto-discovery yields no coverage paths
  • Add acceptance tests for hook coverage functionality
  • Simplify DEBUG trap to avoid redundant should_track calls

✅ To-do list

  • I updated the CHANGELOG.md to reflect the new feature or fix
  • I updated the documentation to reflect the changes

@omargallob omargallob force-pushed the feat/omgallob/improve-coverage branch from dcb2d83 to acd1cc5 Compare December 28, 2025 12:46
@omargallob omargallob changed the title test: improve coverage refactor(coverage): improve coverage inside lifecycle hooks Dec 28, 2025
The src/ fallback is already handled in runner.sh after auto-discovery.
Having it in both places is redundant since runner.sh calls init()
after setting BASHUNIT_COVERAGE_PATHS.
The complex trap was:
- Redundant: record_line already calls should_track internally
- Semantically incorrect: used LINENO from frame 0 with BASH_SOURCE[1]
- Adding overhead: extra function call on every line executed

Revert to simple, efficient trap.
- Add SC2034 disable for environment variables used by bashunit
- Use explicit BASHUNIT_COVERAGE_PATHS="src/" instead of relying on fallback
Chemaclass added a commit that referenced this pull request Dec 29, 2025
The coverage tracking in lifecycle hooks feature causes parallel
test runs to hang indefinitely in GitHub Actions CI.

This reverts all changes from PR #574 until the root cause of
the parallel test hangs can be identified and fixed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Chemaclass added a commit to omargallob/bashunit that referenced this pull request Dec 29, 2025
test runs to hang indefinitely in GitHub Actions CI.

This reverts all changes from PR TypedDevs#574 until the root cause of
the parallel test hangs can be identified and fixed.
@Chemaclass Chemaclass force-pushed the feat/omgallob/improve-coverage branch 3 times, most recently from 2521779 to 3d8b8ec Compare December 29, 2025 16:03
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