Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Running tests

Quick start

cargo test                                        # simulation only
SYMPOSIUM_ENABLE_AGENT_TESTING=1 cargo test       # simulation + configured agents

In PowerShell, set the variable first. It lasts for the rest of the session, so remove it to go back to simulation only:

$env:SYMPOSIUM_ENABLE_AGENT_TESTING = "1"
cargo test
Remove-Item Env:SYMPOSIUM_ENABLE_AGENT_TESTING

Agent-mode tests run only when SYMPOSIUM_ENABLE_AGENT_TESTING is set. Without it, a TestMode::AgentOnly test runs nothing and still reports ok; with --nocapture it prints that no agent ran. When it is set, cargo test runs simulation tests and then re-runs agent-mode tests against each agent listed in test-agents.toml. On a fresh clone (no file), the default is claude-sdk.

Configuring test agents

Create test-agents.toml in the repo root (gitignored):

# Run against these agents. Use `acpr --list` to see ACP registry agents.
test-agents = ["claude-sdk"]

Set to [] to skip agent tests entirely (used in CI):

test-agents = []

Available agent names:

NameBackendNotes
claude-sdkClaude Agent SDK (Python)Requires uv, and ANTHROPIC_API_KEY or a logged-in claude
kiro-cli-acpKiro CLI via ACPRequires kiro-cli in PATH
Any name from acpr --listACP registry via acprAuto-downloaded

Filtering to a single agent

Override with the SYMPOSIUM_TEST_AGENT env var:

SYMPOSIUM_ENABLE_AGENT_TESTING=1 SYMPOSIUM_TEST_AGENT=kiro-cli-acp cargo test --test hook_agent
$env:SYMPOSIUM_ENABLE_AGENT_TESTING = "1"
$env:SYMPOSIUM_TEST_AGENT = "kiro-cli-acp"
cargo test --test hook_agent

This ignores test-agents.toml and runs only the specified agent. cargo test-agent is an alias for cargo test --test hook_agent --, so it needs the same variables.

For example, to reproduce #344 (a skill installed by the first SessionStart is not loadable on the first prompt) on Claude Code:

SYMPOSIUM_ENABLE_AGENT_TESTING=1 SYMPOSIUM_TEST_AGENT=claude-sdk cargo test --test hook_agent skill_installed_by_session_start -- --nocapture
$env:SYMPOSIUM_ENABLE_AGENT_TESTING = "1"
$env:SYMPOSIUM_TEST_AGENT = "claude-sdk"
cargo test --test hook_agent skill_installed_by_session_start -- --nocapture

Running specific test files

cargo test --test hook_agent       # just the agent integration tests
cargo test --test init_sync        # just the init/sync tests
cargo test --test dispatch         # just the CLI dispatch tests

Debugging test failures

Add --nocapture to see test output (agent messages, hook traces):

cargo test --test hook_agent -- --nocapture

On failure, the test’s temporary directory is preserved and its path is printed to stderr so you can inspect the fixture state.

CI

CI runs the suite with cargo nextest run --workspace, which runs every test in its own process and the test binaries in parallel, and runs doctests separately with cargo test --workspace --doc. A test that relies on state another test in the same binary left behind can pass under cargo test and fail in CI; reproduce it locally with cargo nextest run.

Windows

CI runs the full test suite on windows-latest as part of the test matrix (see .github/workflows/ci.yml). To run the tests locally on Windows:

  • Install Git for Windows and make sure sh is on PATH. Git ships it at C:\Program Files\Git\usr\bin. Several tests spawn sh to run script-based hooks and predicates, so a missing sh shows up as unrelated-looking hook failures.
  • The repo’s .gitattributes normalizes checked-out text files to LF. This keeps shebang’d fixtures and shell scripts runnable regardless of core.autocrlf.

The self-update tests run on Windows: set_mock_cargo runs the #!/bin/sh mock through sh via a one-line .cmd shim (production spawns the cargo override directly, so no production code changes). The two auto_update_re_execs_* tests are #[ignore]d on Windows (#[cfg_attr(windows, ignore)]): they overwrite the running binary with a shebang stand-in and re-exec into it, which needs Windows-native process replacement. They still compile on Windows, so they are skipped (not compiled out) and their helpers need no #[cfg]. Porting them to run on Windows is a tracked follow-up.