This document describes how to run tests locally and in CI.
./scripts/run-ci-tests.shThis script runs all the same tests that run in CI:
cargo build- Build all targetscargo test- Run all testscargo clippy- Lint checkscargo fmt --check- Format checks
# Build the project
cargo build --verbose
# Run all tests
cargo test --verbose
# Run only library tests
cargo test --lib
# Run specific test file
cargo test --test keyless_integration
# Run with logging
RUST_LOG=debug cargo test -- --nocapture
# Run ignored tests (e.g., integration tests requiring OIDC)
cargo test --test keyless_integration -- --ignored --nocaptureWe use pre-commit hooks to catch issues before they're committed.
-
Install pre-commit:
pip install pre-commit # or brew install pre-commit # macOS # or sudo apt-get install pre-commit # Ubuntu/Debian
-
Install the git hooks:
pre-commit install
-
(Optional) Run on all files:
pre-commit run --all-files
The pre-commit hooks run:
cargo fmt- Rust code formattingcargo build- Compilation checkcargo clippy- Lintingcargo test- Unit tests- File checks (trailing whitespace, YAML/TOML syntax, etc.)
- Markdown linting
If you need to commit without running hooks:
git commit --no-verify -m "message"Our GitHub Actions CI runs these workflows:
Cargo Build & Test:
- Runs on: Ubuntu, macOS
- Commands:
cargo build --verbosecargo test --verbose
Bazel Build:
- Runs on: Ubuntu, macOS
- Builds:
- Core library:
bazel build //src/lib:wsc - Signing component:
bazel build //src/component:signing_lib - CLI component:
bazel build //src/cli:wasmsign_cli
- Core library:
Keyless Integration Tests:
- Runs on: Ubuntu
- Requires: OIDC token (GitHub Actions environment)
- Command:
cargo test --test keyless_integration -- --ignored --nocapture
Allocation-Free Verification:
- Tests which operations are allocation-free
- Command:
cargo test --features allocation-guard --test real_world_allocation_free -- --test-threads=1 --nocapture
ByteHound Profiling:
- Generates detailed memory allocation profiles
- Requires: ByteHound binary (Linux only)
- Creates interactive web UI for analysis
Two tests in signature::keyless::rekor_verifier::tests are marked #[ignore]:
test_verify_real_production_rekor_entrytest_verify_fresh_rekor_entry_with_current_proof
Why Ignored: These tests use hardcoded Rekor entry data with Merkle tree inclusion proofs that become stale as the Rekor log grows.
Running These Tests:
# Option 1: Run locally with environment variable
RUN_IGNORED_TESTS=true ./scripts/run-ci-tests.sh
# Option 2: Run directly with cargo
cargo test signature::keyless::rekor_verifier::tests -- --ignored --nocaptureUpdating Test Data:
# Step 1: Fetch fresh data from Rekor API
./scripts/update-rekor-test-data.sh
# Step 2: Copy the generated Rust code into rekor_verifier.rs
# (Follow the instructions in the script output)
# Step 3: Verify tests pass
cargo test signature::keyless::rekor_verifier::tests -- --ignored --nocaptureIn CI: These tests run automatically in the rekor-verification job, which fetches fresh data and runs with continue-on-error: true to avoid blocking builds when data is stale.
When to Update: When the Rekor log has grown significantly (every few months) or when developing Rekor verification features.
Alternative: The integration tests in keyless_integration.rs fetch LIVE Rekor data during signing and verify it, providing real-world validation without hardcoded data.
The allocation-guard tests intentionally panic (SIGABRT) when allocations occur in locked phases. This is expected behavior for the phase-locked allocator.
Running successfully:
cargo test --features allocation-guard --test real_world_allocation_free \
-- test_ed25519_signature_verification_raw --test-threads=1 --nocaptureExpected output:
✅ ALLOCATION-FREE! Ed25519 verification succeeded without allocations
src/lib/
├── src/
│ ├── lib.rs # Unit tests in each module
│ ├── signature/
│ │ └── keyless/ # Keyless signing tests
│ └── ...
└── tests/
├── keyless_integration.rs # Integration tests (some require OIDC)
├── allocation_free.rs # Simple allocation tests
└── real_world_allocation_free.rs # Real-world allocation benchmarks
Current test status after rebase:
- Total Tests: 376
- Passing: 374 (99.5%)
- Failing: 2 (Rekor verification - known issue)
- Ignored: Integration tests requiring OIDC environment
cargo test -- --nocapture --test-threads=1cargo test signature::keyless::rekor_verifier::tests::test_verify_real_production_rekor_entry -- --nocaptureRUST_LOG=debug cargo test -- --nocapture-
Install ByteHound:
wget https://github.com/koute/bytehound/releases/download/0.11.0/bytehound-x86_64-unknown-linux-gnu.tgz tar xzf bytehound-x86_64-unknown-linux-gnu.tgz mv bytehound libbytehound.so ~/.cargo/bin/ -
Run tests with profiling:
LD_PRELOAD=~/.cargo/bin/libbytehound.so cargo test --release
-
View results:
bytehound server memory-profiling_*.dat # Open http://localhost:8080
CI runs automatically on:
- Push to
mainbranch - Pull requests to
main - Manual workflow dispatch
View CI results: https://github.com/pulseengine/wsc/actions