empack uses deterministic in-process tests as the primary proof layer, then live E2E to confirm real CLI, filesystem, subprocess, and provider behavior.
Use the mise tasks in ../mise.toml:
mise run test # unit + mock/integration, excludes E2E
mise run e2e # live E2E suite only
mise run e2e:filter add # filtered E2E slice
mise run coverage # instrumented binary + workspace coverage
mise run check # cargo check --workspace --all-targets
mise run clippy # cargo clippy --workspace --all-targets -- -D warningsmise run test is the fast default gate. mise run e2e is a separate live suite because it depends on external tools and network conditions.
This is the first line of proof.
- Pure functions, parser behavior, state transitions, config formatting, dependency graph logic, and mock-backed command flows live here.
- Networking contract tests use recorded fixtures rather than live services when possible.
- New branch-heavy behavior should land here first, especially if it can be driven without a subprocess or live API.
- Adaptive rate-budget coverage belongs here first: header parsing, pacing, shared-budget behavior, and request-path integration should be proven with deterministic tests before relying on E2E.
The E2E suite runs the compiled empack binary against real tools and, where required, live providers.
- Location:
crates/empack-tests/tests/e2e_*.rs - Supporting matrix/workflow coverage also lives in
crates/empack-tests/tests/ - Harness utilities live in
crates/empack-tests/src/e2e.rs - Interactive PTY paths use
expectrlwhere terminal behavior itself is the contract - Non-interactive paths use
assert_cmd - Exit-code coverage includes subprocess checks for usage/config failures, general packwiz/process failures, and network/provider failures
packwiz-txis auto-managed, but live E2E can still be pointed at an override binary withEMPACK_PACKWIZ_BIN
E2E is confirmation, not the only proof. If behavior depends on rare server headers, throttling, timing, or concurrency, add a deterministic in-process test instead of waiting for a live environment to reproduce it.
Use PTY-backed tests or smoke scripts when the UX itself matters:
- interactive init flows
- subprocess output that only appears correctly under a terminal
- long-running smoke runs where live error visibility matters
Current CI-enforced PTY scope is intentionally narrow:
- one active interactive
initPTY test validates resulting config data rather than exact prompt strings - one prompt-sequence PTY test remains
#[ignore]as a manual-only dialoguer rendering check - one active restricted-build PTY test validates the browser-confirm decline path by checking persisted pending state instead of prompt text
- one Unix-only PTY test validates that accepting the browser confirmation launches the platform opener through a fake browser command
- one Unix-only PTY test validates that accepting the browser confirmation, waiting for a watched manual download, and auto-continuing the build succeeds without an extra rerun
- injected interactive and process-provider tests still cover browser-opener invocation semantics on every platform without brittle prompt matching
scripts/import-smoke-test.py defaults to a curated 7-pack golden import and client-full build flow. On POSIX it uses a PTY path so failures surface while the run is still in progress, while still capturing structured results for the final report.
Live E2E coverage requires:
packwiz-txor the managed download path- Java 21+
mise- network access
.env.localwithEMPACK_KEY_CURSEFORGEfor CurseForge-backed cases
Some live tests self-skip when prerequisites are missing. That is expected.
Recorded HTTP fixtures live under crates/empack-tests/fixtures/cassettes/.
Use them for contract verification and response-shape coverage:
./scripts/record-vcr-cassettes.sh --help
./scripts/record-vcr-cassettes.sh --dry-run
./scripts/record-vcr-cassettes.sh --only modrinth/version_file_sha1
./scripts/record-vcr-cassettes.shThese fixtures should carry API-shape assertions that do not need live network timing or throttling behavior.
The structural statements above are the maintained contract. Exact counts below are historical snapshots and will drift as the suite changes; use current CI or a fresh local run for authoritative totals.
Latest documented snapshots:
- 2026-04-10:
mise run testcompleted with 1185 passed and 80 skipped across 24 binaries. - 2026-04-10:
mise run e2eran 79 active E2E tests across 21 binaries, with 46 skipped and one slow path (e2e_build_server_sevenz). - 2026-04-09:
mise run coverageran 1225 tests with 1 skipped across 24 binaries, with two slow paths (e2e_build_server_sevenz,e2e_init_yes_neoforge_legacy_1_20_1). - 2026-04-09: the latest documented coverage snapshot was 88.02% on non-
.test.rsfiles undercrates/empack-lib/srcandcrates/empack/src, and 94.14% onTOTAL. mise run coverageis the combined instrumented path for unit and E2E coverage.- there is no
mise run e2e:containertask in the current repo.