Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

fix: Improve CI reliability and test stability

Maximilian Roosc1306fbc4099
diff --git a/Cargo.lock b/Cargo.lock
index c4bd499e3..a6d31095a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -386,19 +386,6 @@ dependencies = [
"windows-sys 0.59.0",
]
-[[package]]
-name = "console"
-version = "0.16.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b430743a6eb14e9764d4260d4c0d8123087d504eeb9c48f2b2a5e810dd369df4"
-dependencies = [
- "encode_unicode",
- "libc",
- "once_cell",
- "unicode-width",
- "windows-sys 0.61.2",
-]
-
[[package]]
name = "const-random"
version = "0.1.18"
@@ -1106,7 +1093,7 @@ version = "1.44.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8732d3774162a0851e3f2b150eb98f31a9885dd75985099421d393385a01dfd"
dependencies = [
- "console 0.15.11",
+ "console",
"once_cell",
"pest",
"pest_derive",
@@ -2878,7 +2865,6 @@ dependencies = [
"clap",
"clap_complete",
"config",
- "console 0.16.1",
"criterion",
"crossbeam-channel",
"crossterm",
diff --git a/Cargo.toml b/Cargo.toml
index 4fa3dfc5b..c99dbcb64 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -43,7 +43,6 @@ chrono = "0.4"
clap = { version = "4.5", features = ["derive", "unstable-ext"] }
clap_complete = { version = "4.5", features = ["unstable-dynamic"] }
config = "0.15"
-console = "0.16"
crossbeam-channel = "0.5"
crossterm = "0.29"
directories = "6.0"
diff --git a/tests/integration_tests/e2e_shell_post_start.rs b/tests/integration_tests/e2e_shell_post_start.rs
index 9dd11f5d7..a12e06ca1 100644
--- a/tests/integration_tests/e2e_shell_post_start.rs
+++ b/tests/integration_tests/e2e_shell_post_start.rs
@@ -181,22 +181,20 @@ approved-commands = [
output
);
- // Wait for background commands to complete (commands have sleep 0.05 + margin)
- thread::sleep(Duration::from_millis(150));
-
- // Verify both background commands ran
+ // Wait for background commands to complete
let worktree_path = repo
.root_path()
.parent()
.unwrap()
.join("test-repo.parallel-test");
- assert!(
- worktree_path.join("task1.txt").exists(),
- "Task 1 should have completed"
+
+ wait_for_file(
+ worktree_path.join("task1.txt").as_path(),
+ Duration::from_secs(2),
);
- assert!(
- worktree_path.join("task2.txt").exists(),
- "Task 2 should have completed"
+ wait_for_file(
+ worktree_path.join("task2.txt").as_path(),
+ Duration::from_secs(2),
);
}
diff --git a/tests/integration_tests/merge.rs b/tests/integration_tests/merge.rs
index fc4b8c4f3..99fab8cb4 100644
--- a/tests/integration_tests/merge.rs
+++ b/tests/integration_tests/merge.rs
@@ -794,11 +794,11 @@ fn test_merge_auto_commit_with_llm() {
.expect("Failed to write file");
// Configure mock LLM command via config file
- // Use /usr/bin/printf with explicit path for cross-platform consistency
+ // Use sh to consume stdin and return a fixed message (must consume stdin for cross-platform compatibility)
let worktrunk_config = r#"
[commit-generation]
-command = "/usr/bin/printf"
-args = ["%s\n", "fix: improve auth validation logic"]
+command = "sh"
+args = ["-c", "cat >/dev/null && echo 'fix: improve auth validation logic'"]
"#;
fs::write(repo.test_config_path(), worktrunk_config).expect("Failed to write worktrunk config");
@@ -820,11 +820,11 @@ fn test_merge_auto_commit_and_squash() {
.expect("Failed to write file");
// Configure mock LLM command via config file
- // Use /usr/bin/printf with explicit path for cross-platform consistency
+ // Use sh to consume stdin and return a fixed message (must consume stdin for cross-platform compatibility)
let worktrunk_config = r#"
[commit-generation]
-command = "/usr/bin/printf"
-args = ["%s\n", "fix: update file 1 content"]
+command = "sh"
+args = ["-c", "cat >/dev/null && echo 'fix: update file 1 content'"]
"#;
fs::write(repo.test_config_path(), worktrunk_config).expect("Failed to write worktrunk config");