Test Commands Reference
Canonical command reference for running tests from the project root. This is the one place that lists every suite; other docs link here rather than restating commands.
Suite status: Sweettest (Rust) is the primary suite and the only place new tests are
written. Tryorama (TypeScript, tests/) is deprecated โ see tests/DEPRECATED.md.
E2E (Playwright) covers the UI-to-conductor seam โ see ui/tests/README.md.
๐ฆ Sweettest (Rust) โ Primary
Runs Holochain in-process. Faster, no WebSocket round-trip, direct Rust types.
Each DNA has its own Sweettest package. [[test]] binaries (targets for cargo test --test <name>):
| Package | Binaries |
|---|---|
nondominium_sweettest | misc โ ping test, validates full build chain end-to-endperson โ Person zome + hREA bridge testsresource โ Resource zome testsgovernance โ Governance zome tests (hard links, contributions, agreements)nondominium โ NDO Layer 0 (NondominiumIdentity) lifecycle tests |
group_sweettest | group โ group lifecycle, membership, work logs, soft linksndo_anchor โ NDO anchor tests |
lobby_sweettest | lobby โ agent profiles and group announcements |
# Build .dna bundle then run all Rust tests
bun run sweettest
# Same with --nocapture (see test output in real time)
bun run sweettest:verbose
# Skip build:happ if .dna is already built
bun run sweettest:only
Cargo commands directly (inside nix develop):
# Requires LIBCLANG_PATH and BINDGEN_EXTRA_CLANG_ARGS to be set (exported by nix develop)
CARGO_TARGET_DIR=target/native-tests cargo test -p nondominium_sweettest
CARGO_TARGET_DIR=target/native-tests cargo test -p nondominium_sweettest -- --nocapture
# Run a specific test module
CARGO_TARGET_DIR=target/native-tests cargo test --package nondominium_sweettest --test misc
CARGO_TARGET_DIR=target/native-tests cargo test --package nondominium_sweettest --test person
CARGO_TARGET_DIR=target/native-tests cargo test --package nondominium_sweettest --test resource
CARGO_TARGET_DIR=target/native-tests cargo test --package nondominium_sweettest --test governance
Lobby DNA Sweettest
# Prerequisites: build:happ must have been run first
bun run build:happ
# Run all Lobby Sweettest tests
CARGO_TARGET_DIR=target/native-tests cargo test --package lobby_sweettest --test lobby
# With test output visible
CARGO_TARGET_DIR=target/native-tests cargo test --package lobby_sweettest --test lobby -- --nocapture
# Run a single test
CARGO_TARGET_DIR=target/native-tests cargo test --package lobby_sweettest --test lobby announce_group_cross_conductor
Group DNA Sweettest
Tests live in dnas/group/tests/src/group/mod.rs. Covers group creation, get_group (fetch by hash), get_my_group, membership (join/leave/is_member/duplicate-join guard), work logs (log_work, get_work_logs, get_my_work_logs, delete_work_log), soft links (create_soft_link, get_soft_links, delete_soft_link), update_group, and validation rejection cases (empty name, zero hours).
Note: Each test spins up 2 Holochain conductors. Running all 13 tests concurrently requires
--test-threads 6(12 conductors max) to avoid port/resource contention.
# Prerequisites: build:happ must have been run first
bun run build:happ
# Run all Group Sweettest tests (thread-limited to avoid conductor contention)
CARGO_TARGET_DIR=target/native-tests cargo test --package group_sweettest --test group -- --test-threads 6
# With test output visible
CARGO_TARGET_DIR=target/native-tests cargo test --package group_sweettest --test group -- --test-threads 6 --nocapture
# Run a single test (no thread limit needed)
CARGO_TARGET_DIR=target/native-tests cargo test --package group_sweettest --test group join_group_creates_membership
# NDO anchor tests (second binary in the same package)
CARGO_TARGET_DIR=target/native-tests cargo test --package group_sweettest --test ndo_anchor
NDO Layer 0 tests (--test nondominium)
# Run all NDO Layer 0 tests
CARGO_TARGET_DIR=target/native-tests cargo test --test nondominium
# Run a single scenario
CARGO_TARGET_DIR=target/native-tests cargo test --test nondominium ndo_cross_agent_discovery
๐ญ E2E (Playwright + real conductors)
Browser-level coverage of the Lobby โ Group โ NDO holarchy against real conductors. Full
detail, architecture, and debugging notes: ui/tests/README.md.
bun run build:happ # once, or after zome changes โ e2e does NOT rebuild
bun run e2e # headless
bun run e2e:ui # Playwright UI mode (debugging)
E2E_PLAYGROUND=1 bun run e2e # also start `hc playground` for DHT inspection
๐ Tryorama (TypeScript) โ DEPRECATED
Do not write new tests here. Everything below documents the legacy Tryorama suite in
tests/, kept as historical reference only and no longer maintained. New tests go in Sweettest (above). Migration status:tests/DEPRECATED.md.
Basic Test Commands (legacy)
All commands automatically build zomes and package the hApp before running tests.
# Run all tests
bun tests
# Run tests with verbose output
bun tests --reporter=verbose
# Run tests in watch mode for development
bun tests --watch
# Generate coverage reports
bun tests --coverage
๐ฏ Pattern-Based Test Selection
The test system uses file name pattern matching to run specific test subsets:
# Run all person-related tests
bun tests person
# Run all resource-related tests
bun tests resource
# Run all governance-related tests
bun tests governance
# Run all PPR system tests
bun tests ppr
๐ Layer-Specific Test Patterns
# Run all foundation tests (basic connectivity)
bun tests foundation
# Run all integration tests (multi-agent interactions)
bun tests integration
# Run all scenario tests (complete user workflows)
bun tests scenario
๐ง Specific Test Files
# Run specific test files using partial name matching
bun tests person-foundation
bun tests person-integration
bun tests person-scenario
bun tests resource-foundation
bun tests resource-integration
bun tests resource-scenario
bun tests ppr-foundation
bun tests ppr-integration
bun tests ppr-scenarios
bun tests ppr-cryptography
bun tests ppr-debug
bun tests person-capability
bun tests governance-foundation
๐ฏ Development Workflow Commands
# Development with hot reload
bun tests --watch person
# Debug specific test with verbose output
bun tests --reporter=verbose ppr-foundation
# Run tests for a specific feature area
bun tests resource
bun tests governance
bun tests person
๐งน Test Quality & Type Checking
# Run tests with type checking
bun tests --typecheck
# Run type checking only (from tests directory)
cd tests && npm run check
# Run tests with coverage analysis
bun tests --coverage
๐ก Test Development Tips
Test Isolation During Development
Sweettest (Rust): mark unfinished tests #[ignore], or filter by name with cargo test <name>.
Tryorama (legacy): use .only() on specific test blocks to run single tests:
describe.only('specific test suite', () => { ... }) // Run only this suite
it.only('specific test', async () => { ... }) // Run only this test
test.only('specific test', async () => { ... }) // Run only this test
Rust Zome Debugging
Use the warn! macro in Rust zome functions to log debugging info:
#![allow(unused)] fn main() { warn!("Debug info: variable = {:?}", some_variable); warn!("Checkpoint reached in function_name"); warn!("Processing entry: {}", entry_hash); }
๐ฆ Tryorama legacy reference (deprecated)
Everything in this section describes the deprecated
tests/suite. Kept for archaeology.
๐ Test File Structure
tests/src/nondominium/
โโโ person/ # bun tests person
โ โโโ person-foundation-tests.test.ts
โ โโโ person-integration-tests.test.ts
โ โโโ person-scenario-tests.test.ts
โ โโโ person-capability-based-sharing.test.ts
โโโ resource/ # bun tests resource
โ โโโ resource-foundation-tests.test.ts
โ โโโ resource-integration-tests.test.ts
โ โโโ resource-scenario-tests.test.ts
โ โโโ resource-update-test.test.ts
โโโ governance/ # bun tests governance
โ โโโ governance-foundation-tests.test.ts
โ โโโ ppr-system/ # bun tests ppr
โ โโโ ppr-foundation.test.ts
โ โโโ ppr-integration.test.ts
โ โโโ ppr-scenarios.test.ts
โ โโโ ppr-cryptography.test.ts
โ โโโ ppr-debug.test.ts
โโโ misc/ # bun tests misc
โโโ misc.test.ts
๐ฏ Recommended Testing Workflow
- Feature Development:
bun tests --watch <feature-area> - Specific Test Debugging:
bun tests --reporter=verbose <specific-test> - Pre-commit Validation:
bun tests foundation && bun tests --typecheck - Full Validation:
bun tests && bun tests --coverage
๐ Pattern Matching Rules
The bun tests command uses Vitest's file filtering:
- Prefix Matching:
bun tests personmatches all files starting with "person-" - Partial Matching:
bun tests foundationmatches all files containing "foundation" - Specific Files: Use unique parts of filenames for precise selection
- Multiple Patterns: Chain multiple patterns for broader coverage
โก Performance Tips
- Use Specific Patterns:
bun tests person-foundationis faster thanbun tests person - Foundation First: Run foundation tests before integration/scenario tests
- Parallel Execution: Tests run in parallel by default for maximum speed
- Verbose Output: Use
--reporter=verbosefor debugging but not for routine runs
All commands run from the project root and automatically handle the complete build โ test cycle! ๐
Environment: Requires Nix development environment (nix develop) for Holochain binaries.