Skip to content

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

feat: Isolate shell integration tests behind feature flag

Maximilian Roos111a06e5998c
diff --git a/.config/wt.toml b/.config/wt.toml
index de3952e3a..f8bfafdc1 100644
--- a/.config/wt.toml
+++ b/.config/wt.toml
@@ -36,5 +36,5 @@ pre-commit = "pre-commit run --all-files"
# Note: This must come AFTER post-merge-command because [pre-merge-command] starts
# a TOML table section, and everything after it would be inside that section
[pre-merge-command]
-insta = "NEXTEST_STATUS_LEVEL=fail NEXTEST_SUCCESS_OUTPUT=never cargo insta test --check --test-runner nextest --test-runner-fallback true"
+insta = "NEXTEST_STATUS_LEVEL=fail NEXTEST_SUCCESS_OUTPUT=never cargo insta test --check --test-runner nextest --test-runner-fallback true --features shell-integration-tests"
doc = "RUSTDOCFLAGS='-Dwarnings' cargo doc --no-deps"
diff --git a/CLAUDE.md b/CLAUDE.md
index 26f08dfb8..85c1bb6a4 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -40,15 +40,20 @@ fn parse_config() { ... }
# Unit tests (fast, ~200 tests)
cargo test --lib --bins
-# Integration tests (~360 tests, requires bash/zsh/fish shells)
+# Integration tests without shell tests (~300 tests, no external dependencies)
cargo test --test integration
+# Integration tests WITH shell tests (~360 tests, requires bash/zsh/fish)
+cargo test --test integration --features shell-integration-tests
+
# Run all tests via pre-merge hook (recommended before committing)
cargo run -- beta run-hook pre-merge
```
The pre-merge hook runs the full test suite and is the recommended way to verify changes before committing.
+**Shell integration tests** require bash, zsh, and fish. On Linux, run `./dev/setup-claude-code-web.sh` to install them.
+
### Claude Code Web Environment
When working in Claude Code web, run the setup script first:
diff --git a/Cargo.toml b/Cargo.toml
index 2282bb35c..604deec1b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,6 +24,8 @@ consolidate-commits = true
# This is optional to avoid C compilation issues on some platforms
default = ["syntax-highlighting"]
syntax-highlighting = ["dep:tree-sitter", "dep:tree-sitter-bash", "dep:tree-sitter-highlight"]
+# Enable shell integration tests (requires bash, zsh, fish installed on system)
+shell-integration-tests = []
[lib]
name = "worktrunk"
diff --git a/README.md b/README.md
index 916e7ba30..30d2a7933 100644
--- a/README.md
+++ b/README.md
@@ -1103,6 +1103,23 @@ This disables bash syntax highlighting in command output but keeps all core func
<details>
<summary>Developing</summary>
+### Running Tests
+
+**Quick tests (no external dependencies):**
+```bash
+cargo test --lib --bins # Unit tests (~200 tests)
+cargo test --test integration # Integration tests without shell tests (~300 tests)
+```
+
+**Full integration tests (requires bash, zsh, fish):**
+```bash
+cargo test --test integration --features shell-integration-tests
+```
+
+**Dependencies for shell integration tests:**
+- bash, zsh, fish shells
+- Quick setup: `./dev/setup-claude-code-web.sh` (installs shells on Linux)
+
### Releases
Use [cargo-release](https://github.com/crate-ci/cargo-release) to publish new versions:
diff --git a/tests/integration_tests/shell_wrapper.rs b/tests/integration_tests/shell_wrapper.rs
index 4cd364130..62cff7353 100644
--- a/tests/integration_tests/shell_wrapper.rs
+++ b/tests/integration_tests/shell_wrapper.rs
@@ -31,6 +31,9 @@
//! In summary: This isn't a case of "should use insta_cmd instead" - the manual execution
//! is necessary, and file snapshots are the right storage format for escape-code-heavy output.
+// All shell integration tests and infrastructure gated by feature flag
+#![cfg(feature = "shell-integration-tests")]
+
use crate::common::TestRepo;
use insta::assert_snapshot;
use insta_cmd::get_cargo_bin;