Testing and quality
Molt’s GitHub Actions CI runs three independent jobs on macos-latest for pushes and pull requests targeting main.
Complete local matrix
Section titled “Complete local matrix”From the repository root:
npm run checkcargo fmt --manifest-path src-tauri/Cargo.toml --checkcargo clippy --locked --manifest-path src-tauri/Cargo.toml --all-targets -- -D warningscargo test --locked --manifest-path src-tauri/Cargo.toml.venv/bin/python -m pytest tests/python/ -qRun all commands when a change crosses layer boundaries.
Rust checks
Section titled “Rust checks”Clippy
Section titled “Clippy”cargo clippy --locked --manifest-path src-tauri/Cargo.toml --all-targets -- -D warningsCI treats every Clippy warning as an error.
cargo test --locked --manifest-path src-tauri/Cargo.tomlThe selected release includes configuration unit tests for:
- Complete defaults.
- Custom interpreter parsing.
- Empty TOML defaults.
- Partial-section defaults.
- Native-effects parsing.
- Ignoring the legacy theme field.
Rust subprocess tests exercise startup handshakes, per-tab ownership, concurrent startup, FIFO lifecycle behavior, stop/restart, recoverable interrupts, force-kill fallbacks, stderr draining, and atomic storage replacement.
Python kernel tests
Section titled “Python kernel tests”Install pytest into a development environment and run:
python3 -m pytest tests/python/ -vCI uses Python 3.12. The suite starts a fresh kernel_server.py process per test and verifies:
- Ping response.
- Simple stdout execution.
- Namespace persistence across requests.
- Exception capture.
- Stderr capture.
- Namespace reset through the protocol restart message.
- Unknown request types.
- Malformed JSON.
The suite also verifies SystemExit capture, noninteractive stdin, request-shape
validation, the __main__ namespace, and protocol recovery. Rich output remains
outside the protocol.
Frontend checks
Section titled “Frontend checks”Type checking
Section titled “Type checking”npm run typecheckRuns the TypeScript build in no-emit mode.
ESLint
Section titled “ESLint”npm run lintRuns ESLint across the repository’s configured frontend files.
Vitest
Section titled “Vitest”npm run testThe store suite covers initialization, tab changes, cell insertion and deletion, reordering, source updates, cell state and output updates, execution counters, persisted-state restoration, clear behavior, command-mode state, and no-op update guards.
Execution, persistence, hook, toolbar, and store suites cover tab reservations, Run All stopping, stale-result cancellation, load validation, serialized saves, visible errors, and notebook mutations.
Manual integration checks
Section titled “Manual integration checks”Automated tests do not fully cover native Tauri behavior. For relevant changes, verify:
- Main and settings windows open and focus correctly.
- Native effects apply and clear without losing readability.
- A configured interpreter launches the bundled resource.
- Separate tabs retain isolated namespaces.
- Run All is sequential.
- Stop blocks subsequent execution until Restart.
- Restart clears live variables and rendered outputs.
- Interrupt behavior is recoverable through Restart.
- Notebook source restores after app relaunch.
- All child Python processes terminate on app quit.
- Gatekeeper behavior is understood on an unsigned local bundle.
- The DMG build completes in the intended GUI or CI environment.
Test new behavior at the owning layer
Section titled “Test new behavior at the owning layer”| Change | Minimum tests |
|---|---|
| Cell/store mutation | Vitest store test |
| React control behavior | Testing Library component test |
| Tauri invoke wrapper or response mapping | Frontend test with invoke mock plus Rust contract review |
| TOML field | Rust parse/default/save tests and settings UI test |
| Kernel protocol | Python subprocess test and Rust deserialization test |
| Process lifecycle | Rust async test where feasible plus macOS integration check |
| Persistence schema | Frontend load/save tests, malformed-data test, migration behavior |
| Window/menu/native effect | macOS Tauri integration check |
CI behavior
Section titled “CI behavior”- Jobs cancel in-progress runs for the same Git reference.
- Rust dependency caching uses
Swatinem/rust-cachewithsrc-taurias the workspace. - Frontend installation uses
npm ciwith the committed lockfile. - CI validates code but does not produce release artifacts; the release workflow is separate.
