Skip to content

Run the test suite

Run the AWC test suites and the full continuous-integration (CI) gate on your machine. The test program spans several corpora: unit, property and fuzz, manifest golden, differential filesystem, integration, kernel compatibility, fault injection, security, scale, performance, and soak.

The toolchain is pinned by rust-toolchain.toml. Dependencies are locked by Cargo.lock and audited by cargo-deny (deny.toml). Every test corpus is a workspace member, so one --workspace run picks it up.

1. Run the workspace suite

make test

make test runs cargo test --workspace --all-targets. It builds every crate and test target, then runs the unit and integration tests. The manifest golden tests and the checkpoint fault-injection tests run here.

2. Verify formatting

make fmt-check

make fmt-check runs cargo fmt --all -- --check. It fails if any source is not formatted. Run make fmt to fix the formatting in place.

3. Lint the workspace

make lint

make lint runs cargo clippy --workspace --all-targets -- -D warnings. Every warning is an error.

4. Audit dependencies

make deny

make deny runs cargo deny check. It audits licenses, advisories, bans, and sources across the workspace, as configured in deny.toml.

5. Run the full CI gate

make ci

make ci runs make check plus make deny. make check is the fast local gate: fmt-check, lint, and test. The Makefile marks make check as network-free. make ci adds the dependency audit, which may fetch the advisory database on the first run. This is the same gate CI enforces on every change.

Corpora that degrade, not fail

Some corpora report reduced coverage instead of failing when the host lacks privileges or tools. They still run under make test.

  • The overlay kernel matrix corpus: the static probes run privilege-free on any Linux host. The functional, mount-requiring probe reports NotAssessed without CAP_SYS_ADMIN. Run it privileged to exercise the functional categories.
  • The tool compatibility corpus: it materializes a snapshot to a plain directory and runs one documented operation of each certified tool. A tool absent from your PATH is skipped with a note, not failed. No privileges or /dev/fuse are required.
  • The fuse differential and security corpora drive the pure read-path core and the policy gates. They need no /dev/fuse and no privileges.

6. Run the tests with the production features

make test-prod

make test-prod runs the test suites of awcd, awc-control, awc-worker, and awcctl with the exact feature set the release binaries carry: the fuse and s3 features enabled together. The default make test target runs default features only; CI compiles the production union and executes it through make test-prod on every change. Tests that need a real /dev/fuse device stay #[ignore]'d and do not run here either.

7. Run the backing-service suites

make test skips the #[ignore]'d suites that need a live database or object store. Run them separately.

Postgres integration tests:

make ci-pg DATABASE_URL=postgres://localhost/awc_ci

make ci-pg sets AWC_PG_TESTS=1, targets the awc-db, awc-control, awc-worker, awc-gc-safety-tests, and awc-end-to-end-tests packages, and runs --ignored --test-threads=1. Point DATABASE_URL at a fresh database.

minio or S3 transport test (feature s3):

make ci-s3 AWC_S3_ENDPOINT=http://127.0.0.1:9000 AWC_S3_BUCKET=awc-cas \
    AWC_S3_ACCESS_KEY_ID=minio AWC_S3_SECRET_ACCESS_KEY=minio123 \
    AWC_S3_ALLOW_HTTP=1

An http:// endpoint additionally needs AWC_S3_ALLOW_HTTP=1 (plaintext is an explicit opt-in; https is the default), and a real provider needs its SigV4 region via AWC_S3_REGION. Both targets fail loudly if a required variable is unset, so a misconfiguration cannot pass silently.

8. Run a single crate or corpus

Target one workspace package by name:

cargo test -p awc-manifest --all-targets
cargo test -p awc-overlay-kernel-matrix-tests

Run one test by name:

cargo test -p awc-manifest golden

The .cargo/config.toml aliases mirror the Makefile targets, so cargo lint, cargo fmt-check, and cargo deny-check run the same checks.

Measure coverage

make coverage writes an lcov report for the whole workspace. It needs cargo-llvm-cov and the llvm-tools component:

rustup component add llvm-tools
cargo install cargo-llvm-cov --locked
make coverage
# -> lcov.info

The report has no threshold gate. In CI, the coverage workflow runs the same command weekly (Monday 05:23 UTC) and on dispatch, appends the summary to the job summary, and uploads lcov.info as a 14-day artifact.

Measure performance

make test runs the deterministic regression gates as ordinary tests. The wall-clock benchmarks are separate. They run on a reference host, not in CI:

cargo run -p awc-performance --bin awc-perf --release

Next steps