Documentation · Next: Contributing
Choose a test boundary that exercises the behavior you changed. A mock UI pass, a socket test, an emulator run, and a physical-device result establish different things. Report the command, source revision, and relevant boundary.
Use the smallest check that can catch the defect, then add the relevant wider boundary checks. These are complementary evidence layers, not a ladder where one passing result automatically establishes the next.
flowchart TD
Change[Behavior being changed] --> Logic[Pure logic or format bytes]
Change --> UI[UI and IPC behavior]
Change --> Network[Network service behavior]
Change --> Device[Device-facing compatibility]
Logic --> Unit[Crate tests with disposable fixtures]
UI --> Frontend[Vitest and mock-backed Playwright]
Network --> Socket[Loopback protocol integration]
Device --> Firmware[Booted firmware assertions]
Device --> Physical[Named physical-device check]
Device --> Filesystem[Filesystem acceptance check when applicable]
A mock UI test cannot prove native database writes; a protocol client cannot prove firmware navigation; emulator playback cannot prove physical audio or FAT32 behavior on a real USB device. Record each result separately.
Set RB_LITE_TEST=1 for Rust checks; RBXPORT_TEST=1 is the current equivalent.
These guards refuse writes to a detected installed library. Writable tests
must use rbl_db::fixture::build or another explicitly disposable fixture;
the environment variable does not redirect the app to test data.
Never use an installed rekordbox library as a writable development/test target. Do not disable protection to make a test pass. Browser mocks do not open it.
Which of these runs when, and where, is in Test tiers.
| Layer | Location / command | What it checks |
|---|---|---|
| Frontend lint | pnpm lint |
React, TypeScript, and architectural restrictions. |
| Frontend build | pnpm build |
TypeScript and the production bundle. |
| Frontend unit | pnpm test |
Vitest behavior in the configured source/test paths. |
| Rust unit and integration | RB_LITE_TEST=1 cargo test --workspace |
Crate behavior, generated audio, temporary databases, and protocol sessions. |
| Rust lint | cargo clippy --workspace --all-targets -- -D warnings |
Workspace lint and warning policy. |
| Performance budget | pnpm budget |
Budget schema and production bundle size. |
| Browser interaction | pnpm e2e |
Chromium/WebKit UI with the mock backend and production-preview checks. |
Install Playwright browsers once with
pnpm exec playwright install chromium webkit. Run pnpm build before the
bundle budget; pnpm e2e builds the mock preview into dist-mock/ and serves
it through Python's HTTP server. Use E2E_PORT=1500 pnpm e2e when another
checkout uses the default port.
Start small, for example:
pnpm exec vitest run src/store/useAnalysis.test.tsx
pnpm exec playwright test e2e/analysis.spec.ts
RB_LITE_TEST=1 cargo test -p rbl-analysis
RB_LITE_TEST=1 cargo test -p rbl-dbserver --test session
RB_LITE_TEST=1 cargo test -p rbl-link --test linkrbl-fakecdj drives protocol servers over loopback. It exercises socket
framing and server behavior without booting vendor firmware.
Some script checks use Node's own test runner rather than the Vitest glob;
run the relevant file with node --test scripts/<name>.test.mjs when changing it.
Tests requiring AlphaTheta Emulator, imported firmware, private assets, or
physical hardware live in rbxport-private. Registered firmware suites run
from this public checkout:
npm run tests:private
npm run tests:private -- cdj-3000
npm run tests:private -- xdj-azThe default runs CDJ-3000 then XDJ-AZ, sequentially, and stops on failure.
The runner validates suite names and harness paths before starting either.
Set RBXPORT_PRIVATE_REPO when the private repository is not a sibling;
ATEMU_DIR selects the emulator checkout.
| Suite | Harness in rbxport-private | Behavior |
|---|---|---|
cdj-3000 |
scripts/e2e-link/run.sh |
Build RBX, create a three-track fixture, boot a bridged CDJ-3000, and drive LINK browsing/loading/interactions through its firmware panel. |
xdj-az |
scripts/e2e-xdj-az/run.sh |
Generate a disposable FAT32 export, browse its playlist, load deck 1, and run audio/cue assertions. |
The CDJ suite needs the built emulator, imported firmware, Python with pytest
and Pillow, and bridge-helper access (sudo -n on its documented host setup).
The AZ suite additionally uses macOS disk-image tools and an imported cabinet
image (ATEMU_XDJ_AZ_CABINET overrides its path). The harness calls audio tests
in AtEmu's tests/test_xdj_az_playback.py; the current gate uses 44100 Hz and
exclusive audio capture. Follow the private harness README for host setup.
Evidence is saved in the private repository's verification/ directory.
Physical USB formatting has a separate destructive opt-in harness and is not
included in this default run. Private macOS/Windows app harnesses also retain
their own entry points. Do not infer a physical pass from emulator audio.
The removable-media tests run on FAT32, exFAT and HFS+ disk images by
default. To run them on real sticks instead, name two disposable sticks
USB A and USB B, put an empty .rbxport-disposable file at the root of
each, and run:
RBX_REAL_USB=1 RB_LITE_TEST=1 cargo test -p rbl-export --test removable_mediaThe marker says the stick may be overwritten; without it the tests refuse to
write. Before each test, PIONEER, .PIONEER, Contents, the tests' own
folders and rbxport's working files are deleted from both sticks; nothing
else on them is touched. The tests take the sticks one at a time, and one of
them syncs both at once as the Sync Manager does. What the last test leaves
need not be a library a player can read; for one at each stick's root, run
that test on its own. Its tracks are placeholder bytes, so a player can browse
them but not play them.
RBX_REAL_USB=1 RB_LITE_TEST=1 cargo test -p rbl-export --test removable_media a_sync_writes_every_stick_at_onceEvery other test that exports to a stick writes to a temporary directory on
the local disk. RBX_USB_STICK puts that directory on a real stick instead,
so the whole export suite and the app's stick tests run through the stick's
filesystem and driver. It takes one stick at a time, and the same
.rbxport-disposable marker:
RBX_USB_STICK="/Volumes/USB A" RB_LITE_TEST=1 cargo test -p rbl-export -p rbxportEach test's directory is named .rbxport-test-* and removed when the test
ends. On FAT32 and exFAT, macOS keeps extended attributes in ._ sidecar
files; listings in these tests leave them out (common::is_os_metadata).
Add -- --include-ignored to the export crate's run for the opt-in
200/2,000/10,000-track benchmark. It is slow on a stick: on 2026-10-13 its
10,000-track first export alone took 16 minutes on a FAT32 stick and 32 on a
journaled HFS+ one.
For a substantial change, run all applicable checks:
cargo clippy --workspace --all-targets -- -D warnings
RB_LITE_TEST=1 cargo test --workspace
pnpm lint
pnpm build
pnpm test
pnpm budget
pnpm e2eRun relevant private suites for firmware-facing changes when the tools are available. Explain missing checks, failures, and remaining physical-device coverage in the PR. Required generator output accompanies source changes; see Conventions.
- LINK behavior catalog: firmware/model coverage and physical result format.
- Analysis evaluation: private reference playlists and recorded scores.
- USB format verification: structural comparisons and compatibility limits.
- Performance conventions: enforced budgets and measurements.