Skip to content

Test runners and dependency installs ​

Pack contributors use test and install declarations to select project checks and prepare dependencies. These declarations apply across every installed central pack, independent of profile matching; project overlays cannot export either.

test.runners: {id, rank, when, requires?, command|driver, narrow?, db_guard?, failure_hints?, mapped_suffixes?}. IDs are unique within a pack. Lower rank wins across all packs and core defaults (Go 30, Cargo 40, Make 60); absent requirements record unavailability but permit later runners. A selected-but-unavailable runner stops a full run, not an independently mapped affected suite.

narrow: {extensions, name_suffixes} appends conventional test paths to a static command; core rejects unsafe paths before either static or driver narrowing. mapped_suffixes requires explicit affected-map commands for custom discovery. db_guard enables core isolation policy; failure_hints: [{output_contains, lines}] prints lines when any literal needle matches failed output.

Test drivers are declared .mjs assets, also in test.e2e: [{when, driver}]. The bounded Node host uses protocol 1 JSON stdin/stdout. Every request carries op, runner_id, mode, app_root, path_env and package_managers (root . and direct children: npm/pnpm/yarn). Operations:

  • select: response {protocol: 1, status: selected|none|unavailable, command?, evidence?, unavailable_runner?, candidates?}. A selected command is nonempty; optional evidence/unavailability are strings, candidates are sorted subproject paths. Missing host Node records runner unavailability.
  • narrow: adds original command and selected files; a selected response requires a nonempty command and positive retained_count, no larger than the input count.
  • e2e: same selection envelope, without narrowing inputs.

Malformed JSON, invalid envelopes, driver exits and timeouts are discovery errors, never no-match. An optional E2E discovery error does not veto an already selected unit runner; explicit E2E selection or E2E-only discovery still reports it. Test drivers may read project files and spawn the project's own interpreter for bounded, read-only import probes; they may not write files or run installers. Component drivers retain their stricter no-subprocess policy.

JSON evidence ​

json_strings: {file, path?, keys, children?} matches any nonempty string member named in keys under the JSON object's key path (default root). Malformed JSON, missing keys and non-string/empty values do not match. children: true limits discovery to regular files with that plain filename in direct non-hidden child directories, with the same pruning/ignore/symlink bounds as child_file_exists.

Node declarations leave build-only manifests unmatched. A package with Vitest/Jest configuration or node_modules/vitest intentionally declares tests even without a test script. Without an available alternative runner, missing Node reports TEST_RUNNER_UNAVAILABLE (exit 1), not NO_TESTS_DETECTED; configuration-based evidence is sufficient for the required-tool check.

Database probes ​

test_probe is an invocation whose last stdout line is <driver>::<database>. Core runs it for the app and under APP_ENV=testing; forward_env lists inherited variable names; entries ending in _ are prefixes, other entries match exactly. Optional overrides is another invocation emitting NAME\x1fVALUE\x1fFORCE lines for testing: FORCE=1 beats caller values, 0 preserves them. Probe failures are errors. DB collision, sqlite skip and the explicit live-DB bypass remain core policy.

test.db_checks: [{commands, when?, wipe?}] classifies check-run shell segments by literal command substrings. A nonempty commands list is required; when optionally restricts matching to a project predicate. Checks apply only to packs with a db_guard runner. Non-wipe commands also identify test runners during static verify analysis.

  • Check-run follows plain cd segments and uses the declaring pack's database probe with the effective execution environment.
  • Missing observations or identical databases refuse execution (LIVE_DB_REFUSED, exit 4). An in-memory SQLite test database is isolated.
  • Wipes require --env=testing or APP_ENV=testing on their own segment and ignore suite-only override pins.
  • DEVKIT_ALLOW_LIVE_TEST_DB=1 explicitly bypasses the guard (OD_ALLOW_LIVE_TEST_DB=1 remains a legacy alias). Test-prep's initial unresolved/SQLite skip messages do not bypass check-run's stricter check.

Dependency installs ​

install: [{id, when, manifests, ready_when, skip_when_ready, program, attempts: [{when?, args, fallback_marker?}], lockfiles, link_from_origin, preflight_marker}]. All paths are project-relative; markers contain only uppercase letters/underscores. Wave tries due attempts in order using its existing unsandboxed, time-limited install path; after failure, an existing ready environment still succeeds. fallback_marker prints only after an earlier attempt failed. Initially clean declared lockfiles are restored afterwards, alongside Node lockfiles. Preflight prints WAVE_PREFLIGHT_<preflight_marker>_MISSING when due but not ready.

Delegates link declared link_from_origin directories without overwriting occupied paths. Entries with skip_when_ready: true install only for tracked manifests and missing readiness; other entries are link-only in delegates (Python dependencies are never installed there). DEVKIT_INSTALL_BIN_<UPPERCASE_ID> overrides an executable only with DEVKIT_TEST_SEAMS=1. Node dependency installs and package-manager support stay core.

Internal docs — onedot-devkit · devkit

devkitdevkit syncdevkit statusdevkit doctordevkit helpInternal docs · ONEDOT digital crew