chore(batfaster): split monolithic test files for maintainability#56
Closed
olavostauros wants to merge 2 commits into
Closed
chore(batfaster): split monolithic test files for maintainability#56olavostauros wants to merge 2 commits into
olavostauros wants to merge 2 commits into
Conversation
Split tasks.bats (111 tests) into 3 domain-focused files: - tasks-read-send-sig.bats (read, send, sig tasks) - tasks-list-status-unread.bats (list, status, unread, export) - tasks-cursors-remove.bats (cursor, remove, non-existent channel) Split chat_lib.bats (66 tests) into 4 domain-focused files: - chat_lib-resolve.bats (resolve, require_file, identity) - chat_lib-init-cursor.bats (init, line_count, cursor) - chat_lib-messages.bats (append, new_messages, count_new) - chat_lib-format.bats (list, timestamp, to_epoch, relative_time, trim) Added setup_suite.bash for consistent toolpath setup across all test files. Added bats_require_minimum_version 1.10.0 to all 8 test files. No test content changes — same 189 tests, zero failures. Test timing: ~20s (unchanged — task-level tests use mise run shim, so parallel execution is not possible due to mise lock contention).
|
Metric Before After Δ Uhh Olavo |
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.
Summary
Split monolithic test files into domain-focused files for better maintainability, added
setup_suite.bash, and addedbats_require_minimum_versionguards to all test files.Changes
Split
tasks.bats(1253 lines, 111 tests) → 3 files:tasks-read-send-sig.bats(38 tests) — read, send, sig taskstasks-list-status-unread.bats(44 tests) — list, status, unread, exporttasks-cursors-remove.bats(29 tests) — cursor:clear, cursor:undo, remove, non-existent channelSplit
chat_lib.bats(559 lines, 66 tests) → 4 files:chat_lib-resolve.bats(20 tests) — resolve, require_file, identitychat_lib-init-cursor.bats(12 tests) — init, line_count, cursorchat_lib-messages.bats(18 tests) — append, new_messages, count_newchat_lib-format.bats(16 tests) — list, timestamp, to_epoch, relative_time, trimAdded
test/setup_suite.bashwithmise envtoolpath setupAdded
bats_require_minimum_version 1.10.0to all 8 test filesNo test content was changed. Same 189 tests, zero failures.
Timing
Parallel execution note: Task-level tests invoke
mise runinside thechat()shim, which acquires a mise lock. Parallel file execution would cause race conditions on that lock, so--jobswas intentionally omitted.Validation
mise run test— 189/189 pass, 0 failurescodebase lint "$PWD"— all 9 rules passedgit diff --check— passesreadme build --check— passes