soundor-testing
Chooses and sets up the right automated tests for a Soundor audio plugin.
pnpm dlx skills add soundor/skills --skill soundor-testingWhen an agent uses it
Chooses and sets up the right automated tests for a Soundor audio plugin. Covers Rust processor and controller tests with numerical audio checks and allocation counting, UI tests in Vitest against the simulated runtime, end-to-end tests of the built VST3 in Soundor's VST3 host, browser tests of the web build, and VST3 validation, written to check real behavior without flakiness. Use when adding or fixing tests, setting up a test suite or CI for a plugin, deciding how to verify a change, or when a change compiles and still needs proof that it works.
Instructions
A build that compiles proves the types line up. It does not prove the plugin sounds right, saves and restores, responds to automation, or shows what it should. Each of those needs a test at the layer where it happens.
Use what the installed version provides
Soundor's testing packages are versioned with the framework. Before writing
a test, check the installed versions (npm ls --depth=0), look for bundled
skills (find node_modules/soundor node_modules/@soundor -name SKILL.md;
none ship yet), and read the APIs in the packages' .d.ts files, the
generated SDK's testing.rs (.soundor/generated/rust/soundor/src/), and
https://soundor.dev/docs/testing. Install test packages at the version of
the project's soundor package. Prefer these tools to general-purpose
frameworks: they run the plugin's real contract.
Which test for which question
| Question | Test with | Runs |
|---|---|---|
| Does the DSP produce the right numbers? | Rust: soundor::testing::TestProcessor | cargo test, no host |
Does process() allocate? | Rust: CountingAllocator | cargo test |
| Do native methods, state and presets work in Rust? | Rust: soundor::testing::TestController | cargo test |
| Does the UI show and change the right values? | Vitest + @soundor/testing-library (simulated runtime) | Node, milliseconds |
| Does the real plugin process audio as configured? | @soundor/vitest-e2e launchHost() | VST3 host, no display |
| Do UI and audio work together; does state survive restore? | @soundor/vitest-e2e launchPlugin() | VST3 host, needs a display |
| Does it look right, and keep looking right? | toMatchScreenshot, Driver screenshots | VST3 host, display |
| Does the web build work in a browser? | Playwright against the built .soundor/dist/web | Chromium |
| Will DAWs accept the VST3? | pluginval, strictness 10 | the release build |
| Is it fast enough? | a release-mode Rust benchmark marked #[ignore] | cargo test --release |
The tool map describes each package and what it can and cannot see.
Set up
- Rust: ready in a new project.
npm run test:rustrunssoundor genandcargo test. See Rust tests. - UI tests: the scaffold does not install them. Add
vitest,@soundor/vitest,vitest-environment-soundorand@soundor/testing-library, and avitest.config.ts. See UI tests. - End-to-end: add
@soundor/vitest-e2e(and@soundor/vst3-host, which VST3 projects already have), a Debug build, and on headless Linuxxvfb-run. See End-to-end tests. - Web and validation: Playwright for the web build, pluginval for the VST3. See Web build and VST3 validation.
Write tests that prove behavior
- Test behavior, not implementation. Render the app and act as a user;
process audio and measure it. Avoid mocking Soundor itself; mock only
what the simulated runtime cannot run (native methods,
soundor:fs). - Check numbers. Measure gain, frequency response, latency and silence with tolerances suited to the math (0.01 dB for gains, 1e-6 for sample equality); assert that signals are not silent before comparing.
- Find controls as users do: by role and name. A control a test cannot find that way is one a screen reader cannot either.
- Await everything; never sleep. Use
waitFor,findBy…,advanceTime, and in end-to-end tests the retrying matchers andexpect.poll. Fixed delays make tests slow and flaky. - Keep tests independent. Each test sets up its own parameters, state and plugin instance.
- Cover what sessions rely on: parameter changes reach the audio,
state survives
getState/setState, presets load, automation shows in the UI. - Keep regression tests. Never delete or weaken a failing test to make CI pass; fix the cause, or ask.
Before you finish
- Each changed behavior has a test at the layer it lives in.
- DSP changes have numerical tests and an allocation test.
- UI changes have tests that find controls by role and name.
- Changes to parameters, state or presets have a test that goes
through the real plugin (
launchHost) or the Rust harness. - Tests pass locally the way CI runs them (
xvfb-run -afor UI end-to-end tests on Linux), and the report says which suites ran and which could not run here.
References
The skill reads these when a task needs them: