You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: add integration tests for post-commit hook execution #1705
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-commit hook that writes a marker file
Run wt step commit
Use wait_for_file to verify the hook ran
Test failure behavior (background hook — should not affect exit code)
Similar pattern to existing user_post_merge_executes test.
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, runs wt step commit, verifies the hook ran via wait_for_file_content
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.
Activity
max-sixty commentedon Mar 24, 2026
@worktrunk-bot fix
test: add integration tests for post-commit hook execution
worktrunk-bot commentedon Mar 24, 2026
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 codeOne observation: post-commit hooks don't appear to fire during
wt merge(when merge auto-commits dirty changes). The code path inCommitOptions::commit()spawns them, but the merge output shows no "Running post-commit" message. This might be worth a separate investigation.