Skip to content

fix(runner): improve DX for silent test failures#613

Merged
Chemaclass merged 5 commits intomainfrom
fix/dx-silent-test-passes
Mar 19, 2026
Merged

fix(runner): improve DX for silent test failures#613
Chemaclass merged 5 commits intomainfrom
fix/dx-silent-test-passes

Conversation

@Chemaclass
Copy link
Member

Summary

  • Risky test detection: Tests with zero assertions are now flagged as "risky" with a warning (magenta R in simple mode, ⚠ Risky in detailed mode). Does not cause failure — just a DX signal.
  • Strict mode in hooks: set_up() and tear_down() now respect --strict mode flags (-uo pipefail), so unbound variables in hooks are caught.
  • Source failure detection in all hooks: tear_down(), set_up_before_script(), and tear_down_after_script() now detect source of non-existent files (previously only set_up() was protected via Source inexistent file makes test pass #611). Uses set -E (errtrace) instead of set -eE to prevent the main process from crashing on Bash 3.2.
  • Extended error patterns: Added 6 missing Bash runtime error patterns: ambiguous redirect, integer expression expected, too many arguments, value too great, not a valid identifier, unexpected EOF.

Related to #611

Test plan

  • ./bashunit --no-parallel tests/ — all 929 tests pass (897 passed, 20 risky, 0 failed)
  • ./bashunit --parallel --simple tests/ — parallel mode passes
  • make sa — ShellCheck passes
  • make lint — EditorConfig passes
  • New acceptance tests for risky detection, hook source failures, and strict mode in set_up

- Detect risky tests (zero assertions) and show warning
- Apply strict mode flags (-uo pipefail) in hook execution
- Detect source failures in all hooks (tear_down, set_up_before_script,
  tear_down_after_script) using errtrace-based error detection
- Extend runtime error patterns with 6 additional Bash errors:
  ambiguous redirect, integer expression expected, too many arguments,
  value too great, not a valid identifier, unexpected EOF
@Chemaclass Chemaclass added the enhancement New feature or request label Mar 19, 2026
@Chemaclass Chemaclass self-assigned this Mar 19, 2026
@github-actions
Copy link
Contributor

✅ Contributor Report

User: @Chemaclass
Status: Trusted contributor (whitelisted)

This user is on the trusted contributors list and was automatically approved.

@Chemaclass Chemaclass enabled auto-merge March 19, 2026 15:41
@Chemaclass Chemaclass merged commit 2daf49f into main Mar 19, 2026
40 of 41 checks passed
@Chemaclass Chemaclass deleted the fix/dx-silent-test-passes branch March 19, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants