Skip to content

refactor(state): move progress rendering into console_results - #893

Merged
Chemaclass merged 1 commit into
mainfrom
refactor/868-move-rendering-out-of-state
Jul 27, 2026
Merged

refactor(state): move progress rendering into console_results#893
Chemaclass merged 1 commit into
mainfrom
refactor/868-move-rendering-out-of-state

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

🤔 Background

Related #868

bashunit::state::print_line / print_tap_line did terminal and TAP output from the module that otherwise owns counters and the per-test payload. That is a layering inversion, and it was the sole remaining reason for the state.sh → parallel.sh call cycle that #862 broke.

💡 Changes

  • Both functions move to console_results.sh as bashunit::console_results::print_line / ::print_tap_line, with all 11 call sites updated. state.sh now makes no call into the renderer, console_header, parallel or runner.
  • A grep-based guard in state_test.sh pins that, so the edge cannot return through a path no test happens to cover. It was verified to actually fail when a violating call is reintroduced.
  • Compatibility decision: no alias is kept. Neither function was documented API — docs/custom-asserts.md points custom assertions at bashunit::assertion_passed / state::add_assertions_passed, and the documented bashunit::print_line is an unrelated separator helper in globals.sh. A delegating shim in state.sh would have recreated the exact cycle this removes.
  • The print_tap_line tests move from state_test.sh to console_results_test.sh to follow the code.

bashunit::state::print_line / print_tap_line become
bashunit::console_results::print_line / print_tap_line.

Rendering terminal and TAP output from the module that owns counters and
the per-test payload was a layering inversion, and it was the sole
remaining reason for the state.sh -> parallel.sh call cycle that #862
broke. state.sh now makes no call into console_results, console_header,
parallel or runner; a grep-based guard in state_test.sh pins that, so the
edge cannot come back through a path no test happens to cover.

Compatibility decision: no alias is left behind. Neither function was
documented API — docs/custom-asserts.md points custom assertions at
bashunit::assertion_passed / state::add_assertions_passed, and the
documented bashunit::print_line is an unrelated separator helper in
globals.sh. A delegating shim in state.sh would also have recreated the
exact cycle this removes.

The print_tap_line tests move from state_test.sh to
console_results_test.sh to follow the code.

Closes #868
@Chemaclass Chemaclass added the refactoring Refactoring or cleaning related label Jul 27, 2026
@Chemaclass Chemaclass self-assigned this Jul 27, 2026
@Chemaclass
Chemaclass merged commit 8662b79 into main Jul 27, 2026
37 checks passed
@Chemaclass
Chemaclass deleted the refactor/868-move-rendering-out-of-state branch July 27, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Refactoring or cleaning related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant