refactor(state): move progress rendering into console_results - #893
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 Background
Related #868
bashunit::state::print_line/print_tap_linedid 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 thestate.sh → parallel.shcall cycle that #862 broke.💡 Changes
console_results.shasbashunit::console_results::print_line/::print_tap_line, with all 11 call sites updated.state.shnow makes no call into the renderer,console_header,parallelorrunner.state_test.shpins 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.docs/custom-asserts.mdpoints custom assertions atbashunit::assertion_passed/state::add_assertions_passed, and the documentedbashunit::print_lineis an unrelated separator helper inglobals.sh. A delegating shim instate.shwould have recreated the exact cycle this removes.print_tap_linetests move fromstate_test.shtoconsole_results_test.shto follow the code.