Skip to content

Commit e7703f5

Browse files
committed
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.
1 parent 2521779 commit e7703f5

File tree

4 files changed

+1
-71
lines changed

4 files changed

+1
-71
lines changed

src/coverage.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function bashunit::coverage::enable_trap() {
9595
# Set DEBUG trap to record line execution
9696
# Use ${VAR:-} to handle unset variables when set -u is active (in subshells)
9797
# shellcheck disable=SC2154
98-
trap 'bashunit::coverage::record_line "${BASH_SOURCE[0]:-}" "${LINENO:-}"' DEBUG
98+
trap 'bashunit::coverage::record_line "${BASH_SOURCE:-}" "${LINENO:-}"' DEBUG
9999
}
100100

101101
function bashunit::coverage::disable_trap() {

src/runner.sh

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ function bashunit::runner::load_test_files() {
2323
# Auto-discover coverage paths if not explicitly set
2424
if [[ -z "$BASHUNIT_COVERAGE_PATHS" ]]; then
2525
BASHUNIT_COVERAGE_PATHS=$(bashunit::coverage::auto_discover_paths "${files[@]}")
26-
# Fallback: if auto-discovery yields no paths, track the src/ folder
27-
if [[ -z "$BASHUNIT_COVERAGE_PATHS" ]]; then
28-
BASHUNIT_COVERAGE_PATHS="src/"
29-
fi
3026
fi
3127
bashunit::coverage::init
3228
fi
@@ -854,16 +850,8 @@ function bashunit::runner::execute_file_hook() {
854850
trap '_BASHUNIT_HOOK_ERR_STATUS=$?; set +eE; trap - ERR; return $_BASHUNIT_HOOK_ERR_STATUS' ERR
855851

856852
{
857-
# Enable coverage trap inside hooks to attribute lines executed during setup/teardown
858-
if bashunit::env::is_coverage_enabled; then
859-
bashunit::coverage::enable_trap
860-
fi
861853
"$hook_name"
862854
} >"$hook_output_file" 2>&1
863-
# Disable coverage trap after hook execution
864-
if bashunit::env::is_coverage_enabled; then
865-
bashunit::coverage::disable_trap
866-
fi
867855

868856
# Capture exit status from global variable and clean up
869857
status=$_BASHUNIT_HOOK_ERR_STATUS
@@ -955,16 +943,8 @@ function bashunit::runner::execute_test_hook() {
955943
trap '_BASHUNIT_HOOK_ERR_STATUS=$?; set +eE; trap - ERR; return $_BASHUNIT_HOOK_ERR_STATUS' ERR
956944

957945
{
958-
# Enable coverage trap inside test-level hooks
959-
if bashunit::env::is_coverage_enabled; then
960-
bashunit::coverage::enable_trap
961-
fi
962946
"$hook_name"
963947
} >"$hook_output_file" 2>&1
964-
# Disable coverage trap after hook execution
965-
if bashunit::env::is_coverage_enabled; then
966-
bashunit::coverage::disable_trap
967-
fi
968948

969949
# Capture exit status from global variable and clean up
970950
status=$_BASHUNIT_HOOK_ERR_STATUS

tests/acceptance/coverage_hooks_test.sh

Lines changed: 0 additions & 35 deletions
This file was deleted.

tests/acceptance/fixtures/test_coverage_hooks.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)