test: add integration tests for post-commit hook execution
Missing Coverage
The post-commit hook type was added in #1679 (hook rationalization) and is wired into wt step commit and wt step squash. However, there are no integration tests verifying that post-commit hooks actually execute after a commit.
Completion tests confirm the hook name appears in the CLI, but no test configures a post-commit hook, runs a commit operation, and verifies the hook ran.
Suggested Tests
Add tests in tests/integration_tests/user_hooks.rs (or a new file) that:
- Configure a
post-commithook that writes a marker file - Run
wt step commit - Use
wait_for_fileto verify the hook ran - Test failure behavior (background hook — should not affect exit code)
Similar pattern to existing user_post_merge_executes test.
@worktrunk-bot fix
Added integration tests for post-commit hook execution in #1711.
Three tests covering wt step commit:
test_user_post_commit_hook_executes— configures a post-commit hook that writes a marker file, runswt step commit, verifies the hook ran viawait_for_file_contenttest_user_post_commit_skipped_with_no_verify— verifies--no-verifyskips post-commit hookstest_user_post_commit_failure_does_not_block_commit— verifies failing background hook doesn't affect exit code
One observation: post-commit hooks don't appear to fire during wt merge (when merge auto-commits dirty changes). The code path in CommitOptions::commit() spawns them, but the merge output shows no "Running post-commit" message. This might be worth a separate investigation.