From 5d05ff54cfa91d06a73a94b237c1a80172c5fc06 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Feb 2026 22:16:54 +0000 Subject: [PATCH 1/3] Add test-runner skill for Claude Code Provides instructions for running the test suite, including cargo nextest for unit/integration tests, doc tests, formatting checks, and clippy. Documents prerequisites, database requirements, and WASM binary setup. https://claude.ai/code/session_01JNkEDu5MMVGw7bKGNo56QZ --- .claude/skills/test-runner.md | 80 +++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .claude/skills/test-runner.md diff --git a/.claude/skills/test-runner.md b/.claude/skills/test-runner.md new file mode 100644 index 0000000..e1889a5 --- /dev/null +++ b/.claude/skills/test-runner.md @@ -0,0 +1,80 @@ +# Test Runner + +Use this skill to run the project's test suite. This is a Rust workspace that uses +`cargo-nextest` as the test runner, with tests that require a PostgreSQL database +and pre-built WebAssembly binaries. + +## Prerequisites + +The SessionStart hook (`.claude/hooks/session-start.sh`) installs required tools and +starts PostgreSQL. If the environment is not set up, run: + +```sh +cargo xtask claude setup +``` + +This ensures `cargo-nextest`, `cargo-component`, the `wasm32-wasip1` target, and a +PostgreSQL database are all available. + +## Running the full test suite + +Run all tests (unit, integration, and deterministic simulation tests): + +```sh +cargo nextest run --locked --all-targets --all-features --no-fail-fast +``` + +The nextest configuration in `.config/nextest.toml` automatically triggers a setup +script that builds the required WASM test binaries before running tests that depend +on them. + +## Running doc tests + +Doc tests are not supported by nextest and must be run separately: + +```sh +cargo test --doc --all-features --locked +``` + +## Running a specific test + +Pass a filter expression or test name to nextest: + +```sh +cargo nextest run --locked --all-features -E 'test(test_name)' +``` + +Or use a simple string filter: + +```sh +cargo nextest run --locked --all-features test_name +``` + +## Running tests for a specific crate + +```sh +cargo nextest run --locked --all-features -p crate-name +``` + +## Checking formatting + +```sh +cargo fmt --all -- --check +``` + +## Running clippy + +```sh +cargo clippy --all-targets --all-features +``` + +## Key details + +- Tests in `crates/durable-test/` use `#[sqlx::test]` and require a running + PostgreSQL instance. The `DATABASE_URL` environment variable must be set (the + session-start hook writes this to `.env`). +- The nextest setup script (`crates/durable-test/setup.sh`) builds WASM binaries + from `crates/durable-test-workflows/` with `cargo component build --profile wasm`. + These binaries are loaded by integration tests at runtime. +- CI uses the `dev-ci` cargo profile for faster builds. You can add + `--cargo-profile dev-ci` to nextest commands locally for the same behavior. From 22af643dfe869b87d3d77851544f35c43f6c5738 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Feb 2026 22:21:36 +0000 Subject: [PATCH 2/3] Revise test-runner skill to follow best practices Add required YAML frontmatter with name and description fields. Trim verbose explanations that Claude already knows, keeping only project-specific context like exact commands and environment details. https://claude.ai/code/session_01JNkEDu5MMVGw7bKGNo56QZ --- .claude/skills/test-runner.md | 64 ++++++++--------------------------- 1 file changed, 15 insertions(+), 49 deletions(-) diff --git a/.claude/skills/test-runner.md b/.claude/skills/test-runner.md index e1889a5..10ee3c2 100644 --- a/.claude/skills/test-runner.md +++ b/.claude/skills/test-runner.md @@ -1,80 +1,46 @@ -# Test Runner +--- +name: running-tests +description: Runs the project test suite using cargo-nextest, including unit tests, integration tests, doc tests, formatting checks, and clippy. Use when the user asks to run tests, check code quality, verify changes, or validate before committing. +--- -Use this skill to run the project's test suite. This is a Rust workspace that uses -`cargo-nextest` as the test runner, with tests that require a PostgreSQL database -and pre-built WebAssembly binaries. +# Running Tests ## Prerequisites -The SessionStart hook (`.claude/hooks/session-start.sh`) installs required tools and -starts PostgreSQL. If the environment is not set up, run: +If the environment is not set up, run `cargo xtask claude setup`. -```sh -cargo xtask claude setup -``` - -This ensures `cargo-nextest`, `cargo-component`, the `wasm32-wasip1` target, and a -PostgreSQL database are all available. - -## Running the full test suite - -Run all tests (unit, integration, and deterministic simulation tests): +## Full test suite ```sh cargo nextest run --locked --all-targets --all-features --no-fail-fast ``` -The nextest configuration in `.config/nextest.toml` automatically triggers a setup -script that builds the required WASM test binaries before running tests that depend -on them. +Nextest automatically builds WASM test binaries via `.config/nextest.toml` setup scripts before running tests. -## Running doc tests +## Doc tests -Doc tests are not supported by nextest and must be run separately: +Nextest does not support doc tests; run them separately: ```sh cargo test --doc --all-features --locked ``` -## Running a specific test - -Pass a filter expression or test name to nextest: - -```sh -cargo nextest run --locked --all-features -E 'test(test_name)' -``` - -Or use a simple string filter: +## Specific test or crate ```sh cargo nextest run --locked --all-features test_name -``` - -## Running tests for a specific crate - -```sh cargo nextest run --locked --all-features -p crate-name ``` -## Checking formatting +## Formatting and clippy ```sh cargo fmt --all -- --check -``` - -## Running clippy - -```sh cargo clippy --all-targets --all-features ``` ## Key details -- Tests in `crates/durable-test/` use `#[sqlx::test]` and require a running - PostgreSQL instance. The `DATABASE_URL` environment variable must be set (the - session-start hook writes this to `.env`). -- The nextest setup script (`crates/durable-test/setup.sh`) builds WASM binaries - from `crates/durable-test-workflows/` with `cargo component build --profile wasm`. - These binaries are loaded by integration tests at runtime. -- CI uses the `dev-ci` cargo profile for faster builds. You can add - `--cargo-profile dev-ci` to nextest commands locally for the same behavior. +- Integration tests use `#[sqlx::test]` and require `DATABASE_URL` to be set (the session-start hook writes `.env`). +- The nextest setup script runs `cargo component build --profile wasm -p durable-test-workflows` to build WASM binaries loaded by tests at runtime. +- CI uses the `dev-ci` cargo profile. Add `--cargo-profile dev-ci` for the same behavior locally. From f3fe49faf8e5c5ebac161e5318e1eb1070ae15a6 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Feb 2026 22:23:03 +0000 Subject: [PATCH 3/3] Remove formatting, clippy, and doc test sections from test-runner skill https://claude.ai/code/session_01JNkEDu5MMVGw7bKGNo56QZ --- .claude/skills/test-runner.md | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.claude/skills/test-runner.md b/.claude/skills/test-runner.md index 10ee3c2..19efa8d 100644 --- a/.claude/skills/test-runner.md +++ b/.claude/skills/test-runner.md @@ -1,6 +1,6 @@ --- name: running-tests -description: Runs the project test suite using cargo-nextest, including unit tests, integration tests, doc tests, formatting checks, and clippy. Use when the user asks to run tests, check code quality, verify changes, or validate before committing. +description: Runs the project test suite using cargo-nextest, including unit and integration tests. Use when the user asks to run tests, verify changes, or validate before committing. --- # Running Tests @@ -17,14 +17,6 @@ cargo nextest run --locked --all-targets --all-features --no-fail-fast Nextest automatically builds WASM test binaries via `.config/nextest.toml` setup scripts before running tests. -## Doc tests - -Nextest does not support doc tests; run them separately: - -```sh -cargo test --doc --all-features --locked -``` - ## Specific test or crate ```sh @@ -32,13 +24,6 @@ cargo nextest run --locked --all-features test_name cargo nextest run --locked --all-features -p crate-name ``` -## Formatting and clippy - -```sh -cargo fmt --all -- --check -cargo clippy --all-targets --all-features -``` - ## Key details - Integration tests use `#[sqlx::test]` and require `DATABASE_URL` to be set (the session-start hook writes `.env`).