feat: add bats test suite with GHA CI#3
Merged
vojtabiberle merged 2 commits intomasterfrom Mar 3, 2026
Merged
Conversation
Add 58 tests (23 unit + 35 integration) covering all git-wt commands, configuration layering, shell wrapper, and edge cases using bats-core. - test/test_helper.bash: shared setup with isolated git repos - test/unit/: sanitize_branch, version_gt, worktree_path_for, main_dispatch - test/integration/: cmd_add, cmd_rm, cmd_cd, cmd_ls, config, shell_wrapper, edge_cases - .github/workflows/test.yml: CI on push/PR to master - Makefile: test, test-unit, test-integration targets - git-wt: add __GIT_WT_TESTING source guard for unit test sourcing
The wt() function calls `git wt` which requires git-wt on PATH. Locally it works because git-wt is already on PATH, but CI needs it explicitly.
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
make test,make test-unit,make test-integrationTest coverage
sanitize_branchversion_gtworktree_path_formain_dispatchcmd_addcmd_rmcmd_cdcmd_lsconfigshell_wrapperedge_casesSource change
git-wt:582:__GIT_WT_TESTINGsource guard to allow unit test sourcing without triggeringmain()Test plan
make test-unit— 23 tests passmake test-integration— 35 tests pass