Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Enable ~49 more Windows tests (#157)
Maximilian Roos7b6e90d248d6
diff --git a/tests/integration_tests/approval_ui.rs b/tests/integration_tests/approval_ui.rsindex 8bf03f608..9a1fba639 100644--- a/tests/integration_tests/approval_ui.rs+++ b/tests/integration_tests/approval_ui.rs@@ -105,9 +105,7 @@ approved-commands = ["echo 'Second command'"]);}-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_force_flag_does_not_save_approvals(repo: TestRepo) {repo.write_project_config(r#"post-create = "echo 'test command' > output.txt""#);@@ -143,9 +141,7 @@ fn test_force_flag_does_not_save_approvals(repo: TestRepo) {);}-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_already_approved_commands_skip_prompt(repo: TestRepo) {repo.write_project_config(r#"post-create = "echo 'approved' > output.txt""#);@@ -314,9 +310,7 @@ fn test_approval_fails_in_non_tty(repo: TestRepo) {/// Test that --force flag bypasses TTY requirement////// Even in non-TTY environments, --force should allow commands to execute.-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_force_bypasses_tty_check(repo: TestRepo) {repo.write_project_config(r#"post-create = "echo 'test command'""#);repo.commit("Add config");@@ -339,9 +333,7 @@ fn test_force_bypasses_tty_check(repo: TestRepo) {/// When `wt hook post-merge` runs standalone (not via `wt merge`), the `{{ target }}`/// variable should be the current branch, not always the default branch./// This allows hooks to behave correctly when testing from feature worktrees.-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_hook_post_merge_target_is_current_branch(repo: TestRepo) {// Hook that writes {{ target }} to a file so we can verify its valuerepo.write_project_config(r#"post-merge = "echo '{{ target }}' > target-branch.txt""#);@@ -378,9 +370,7 @@ fn test_hook_post_merge_target_is_current_branch(repo: TestRepo) {}/// Test that `{{ target }}` is the current branch for pre-merge standalone-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_hook_pre_merge_target_is_current_branch(repo: TestRepo) {// Hook that writes {{ target }} to a file so we can verify its valuerepo.write_project_config(r#"pre-merge = "echo '{{ target }}' > target-branch.txt""#);@@ -417,9 +407,7 @@ fn test_hook_pre_merge_target_is_current_branch(repo: TestRepo) {}/// Test running a specific named hook command-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_step_hook_run_named_command(repo: TestRepo) {// Config with multiple named commandsrepo.write_project_config(@@ -501,9 +489,7 @@ fn test_step_hook_name_filter_on_unnamed_command(repo: TestRepo) {}/// Test running all hooks (no name filter) still works-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_step_hook_run_all_commands(repo: TestRepo) {// Config with multiple named commandsrepo.write_project_config(diff --git a/tests/integration_tests/merge.rs b/tests/integration_tests/merge.rsindex d5ed9c4b0..18a0a0c57 100644--- a/tests/integration_tests/merge.rs+++ b/tests/integration_tests/merge.rs@@ -837,8 +837,6 @@ fn test_merge_post_merge_command_failure(mut repo: TestRepo) {);}-/// Skipped on Windows: snapshot output differs due to shell/path differences.-#[cfg_attr(windows, ignore)]#[rstest]fn test_merge_post_merge_command_named(mut repo: TestRepo) {// Create project config with named post-merge commands@@ -888,8 +886,6 @@ deploy = "echo 'Deploying branch {{ branch }}' > deploy.txt");}-/// Skipped on Windows: snapshot output differs due to shell/path differences.-#[cfg_attr(windows, ignore)]#[rstest]fn test_merge_post_merge_runs_with_nothing_to_merge(mut repo: TestRepo) {// Verify post-merge hooks run even when there's nothing to merge@@ -927,8 +923,6 @@ fn test_merge_post_merge_runs_with_nothing_to_merge(mut repo: TestRepo) {);}-/// Skipped on Windows: snapshot output differs due to shell/path differences.-#[cfg_attr(windows, ignore)]#[rstest]fn test_merge_post_merge_runs_from_main_branch(repo: TestRepo) {// Verify post-merge hooks run when merging from main to main (nothing to do)@@ -960,8 +954,6 @@ fn test_merge_post_merge_runs_from_main_branch(repo: TestRepo) {);}-/// Skipped on Windows: snapshot output differs due to shell/path differences.-#[cfg_attr(windows, ignore)]#[rstest]fn test_merge_pre_commit_command_success(mut repo: TestRepo) {// Create project config with pre-commit command@@ -1016,8 +1008,6 @@ fn test_merge_pre_commit_command_failure(mut repo: TestRepo) {);}-/// Skipped on Windows: snapshot output differs due to shell/path differences.-#[cfg_attr(windows, ignore)]#[rstest]fn test_merge_pre_squash_command_success(mut repo: TestRepo) {// Create project config with pre-commit command (used for both squash and no-squash)diff --git a/tests/integration_tests/post_start_commands.rs b/tests/integration_tests/post_start_commands.rsindex 86428f078..2452c5dce 100644--- a/tests/integration_tests/post_start_commands.rs+++ b/tests/integration_tests/post_start_commands.rs@@ -44,9 +44,7 @@ fn test_post_create_no_config(repo: TestRepo) {snapshot_switch("post_create_no_config", &repo, &["--create", "feature"]);}-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_post_create_single_command(repo: TestRepo) {// Create project config with a single command (string format)repo.write_project_config(r#"post-create = "echo 'Setup complete'""#);@@ -70,9 +68,7 @@ approved-commands = ["echo 'Setup complete'"]);}-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_post_create_named_commands(repo: TestRepo) {// Create project config with named commands (table format)repo.write_project_config(@@ -598,8 +594,6 @@ approved-commands = ["cat > context.json"]// Post-Start Command Tests (parallel, background)// ============================================================================-/// Skipped on Windows: snapshot output differs due to shell/path differences.-#[cfg_attr(windows, ignore)]#[rstest]fn test_post_start_single_background_command(repo: TestRepo) {// Create project config with a background command@@ -636,8 +630,6 @@ approved-commands = ["sleep 0.1 && echo 'Background task done' > background.txt"wait_for_file(output_file.as_path(), Duration::from_secs(5));}-/// Skipped on Windows: snapshot output differs due to shell/path differences.-#[cfg_attr(windows, ignore)]#[rstest]fn test_post_start_multiple_background_commands(repo: TestRepo) {// Create project config with multiple background commands (table format)@@ -681,8 +673,6 @@ approved-commands = [);}-/// Skipped on Windows: snapshot output differs due to shell/path differences.-#[cfg_attr(windows, ignore)]#[rstest]fn test_both_post_create_and_post_start(repo: TestRepo) {// Create project config with both command typesdiff --git a/tests/integration_tests/remove.rs b/tests/integration_tests/remove.rsindex 82e3ddc4e..5858fd917 100644--- a/tests/integration_tests/remove.rs+++ b/tests/integration_tests/remove.rs@@ -708,8 +708,6 @@ fn test_remove_squash_merged_then_main_advanced(repo: TestRepo) {// ============================================================================/// Test pre-remove hook executes before worktree removal.-/// Skipped on Windows: snapshot output differs due to shell/path differences.-#[cfg_attr(windows, ignore)]#[rstest]fn test_pre_remove_hook_executes(mut repo: TestRepo) {// Create project config with pre-remove hookdiff --git a/tests/integration_tests/switch.rs b/tests/integration_tests/switch.rsindex 019cfcb93..3e1746136 100644--- a/tests/integration_tests/switch.rs+++ b/tests/integration_tests/switch.rs@@ -222,10 +222,8 @@ fn test_switch_error_path_occupied(repo: TestRepo) {// Cleanupstd::fs::remove_dir_all(&expected_path).ok();}-// Execute flag tests (Unix only due to shell differences)-/// Skipped on Windows: snapshot output differs due to shell/path differences.+// Execute flag tests#[rstest]-#[cfg_attr(windows, ignore)]fn test_switch_execute_success(repo: TestRepo) {snapshot_switch("switch_execute_success",@@ -234,9 +232,7 @@ fn test_switch_execute_success(repo: TestRepo) {);}-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_switch_execute_creates_file(repo: TestRepo) {let create_file_cmd = "echo 'test content' > test.txt";@@ -258,9 +254,7 @@ fn test_switch_execute_failure(repo: TestRepo) {);}-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_switch_execute_with_existing_worktree(mut repo: TestRepo) {repo.add_worktree("existing-exec");@@ -273,9 +267,7 @@ fn test_switch_execute_with_existing_worktree(mut repo: TestRepo) {);}-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_switch_execute_multiline(repo: TestRepo) {let multiline_cmd = "echo 'line1'\necho 'line2'\necho 'line3'";@@ -286,9 +278,7 @@ fn test_switch_execute_multiline(repo: TestRepo) {);}// --no-verify flag tests-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_switch_no_config_commands_execute_still_runs(repo: TestRepo) {snapshot_switch("switch_no_hooks_execute_still_runs",@@ -345,9 +335,7 @@ approved-commands = ["{}"]);}-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_switch_no_config_commands_with_existing_worktree(mut repo: TestRepo) {repo.add_worktree("existing-no-hooks");diff --git a/tests/integration_tests/user_hooks.rs b/tests/integration_tests/user_hooks.rsindex 7a2ee4433..70ca498cb 100644--- a/tests/integration_tests/user_hooks.rs+++ b/tests/integration_tests/user_hooks.rs@@ -32,9 +32,7 @@ fn snapshot_switch(test_name: &str, repo: &TestRepo, args: &[&str]) {});}-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_user_post_create_hook_executes(repo: TestRepo) {// Write user config with post-create hook (no project config)repo.write_test_config(@@ -62,9 +60,7 @@ log = "echo 'USER_POST_CREATE_RAN' > user_hook_marker.txt");}-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_user_hooks_run_before_project_hooks(repo: TestRepo) {// Create project config with post-create hookrepo.write_project_config(r#"post-create = "echo 'PROJECT_HOOK' >> hook_order.txt""#);@@ -97,9 +93,7 @@ approved-commands = ["echo 'PROJECT_HOOK' >> hook_order.txt"]assert_eq!(lines[1], "PROJECT_HOOK", "Project hook should run second");}-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_user_hooks_no_approval_required(repo: TestRepo) {// Write user config with hook but NO pre-approved commands// (unlike project hooks, user hooks don't require approval)@@ -190,9 +184,7 @@ failing = "exit 1"// User Post-Start Hook Tests (Background)// ============================================================================-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_user_post_start_hook_executes(repo: TestRepo) {// Write user config with post-start hook (background)repo.write_test_config(@@ -258,9 +250,7 @@ fn snapshot_merge(test_name: &str, repo: &TestRepo, args: &[&str], cwd: Option<&});}-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_user_pre_merge_hook_executes(mut repo: TestRepo) {// Create feature worktree with a commitlet feature_wt =@@ -401,9 +391,7 @@ long = "sh -c 'echo start >> hook.log; sleep 30; echo done >> hook.log'"// User Post-Merge Hook Tests// ============================================================================-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_user_post_merge_hook_executes(mut repo: TestRepo) {// Create feature worktree with a commitlet feature_wt =@@ -545,9 +533,7 @@ block = "exit 1"// User Pre-Commit Hook Tests// ============================================================================-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_user_pre_commit_hook_executes(mut repo: TestRepo) {// Create feature worktreelet feature_wt = repo.add_worktree("feature");@@ -606,9 +592,7 @@ lint = "exit 1"// Template Variable Tests// ============================================================================-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_user_hook_template_variables(repo: TestRepo) {// Write user config with hook using template variablesrepo.write_test_config(@@ -643,9 +627,7 @@ vars = "echo 'repo={{ repo }} branch={{ branch }}' > template_vars.txt"// Combined User and Project Hooks Tests// ============================================================================-/// Skipped on Windows: snapshot output differs due to shell/path differences.#[rstest]-#[cfg_attr(windows, ignore)]fn test_user_and_project_post_start_both_run(repo: TestRepo) {// Create project config with post-start hookrepo.write_project_config(r#"post-start = "echo 'PROJECT_POST_START' > project_bg.txt""#);