Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Testing & CI

Everything runs through pixi so the toolchain is reproducible. One gate:

pixi run ci        # = fmt + fmt-ui + clippy + test + test-native-git
                   #   + test-ui + check-ui + deny + checks + third-party-check + docs
                   #   (the list that is true is the `ci` task in pixi.toml)

The suites

TaskWhat it runs
pixi run testcargo test --workspace — the Rust unit + integration tests.
pixi run test-uiVitest (jsdom) — the markdown→HTML render seam and app flows.
pixi run check-uisvelte-check over every component. vite build does not typecheck — it strips types and emits — so without this a component calling a function it never imported builds clean and throws in the browser.
pixi run seamthe zero-I/O fm-query suite (seam 1).
pixi run perfsearch-under-budget (< 100 ms at 10k notes).
pixi run denycargo deny — license/advisory gate (permissive-only).
pixi run checksarchitectural greps (see below).
pixi run third-party-checkTHIRD-PARTY.md still describes the tree it claims to. Regenerate with pixi run third-party.
pixi run docsbuilds this book; broken links fail the build.

Environments

pixi.toml defines three, and a task belongs to exactly one. Running a task from the wrong one is a real hazard rather than a tidiness point: the environments resolve their own nodejs/pnpm, and a mobile CLI run from the wrong one has already re-resolved a dependency and broken a build.

EnvironmentFor
defaulteverything above, and the optional media tools (pdftotext, vipsthumbnail, restic), so the tests that probe for them exercise them instead of skipping.
androidthe Android toolchain: pixi run -e android android-release, android-smoke.
crossthe cross-compilation targets. pixi run -e cross check-cross type-checks Myrme’s fm-agent crate for Windows, macOS and both iOS targets.

Opt-in suites — not in the gate, and each for a reason

These are cheap, they run locally, and none of them needs CI. They are outside pixi run ci because they are slow, need a toolchain the gate does not, or are for one platform.

TaskRun it when
pixi run -e cross check-crossafter touching anything per-OS in Myrme’s fm-agent. It found a no-op std::mem::forget on a raw pointer and a deprecated libc::mach_host_self on its first run, in code that had shipped without ever being compiled for either target.
pixi run check-pins (in Myrme’s repository)when a model or runtime pin moves. Downloads ~110 MB and checks every pinned runtime is really there.
(the assistant)its own tests — the download wrappers, the evals, pixi run integration against this app — run in Myrme’s repository, https://github.com/formicaria-org/myrme.
pixi run -e android android-smokeafter an Android change, with a device or emulator attached.

Conventions

  • Hermetic. Tests use tempfile::tempdir or the in-RAM MemoryStore; no network, no shared state. Tests needing a subprocess tool (e.g. restic, pdftotext) probe for it and skip with a message when it’s absent, so the suite stays green outside the full env while pixi run exercises it for real.
  • Contract equivalence. FileStore is tested to behave identically to MemoryStore, so command tests written against the memory store hold in production.
  • Byte round-trip. A note read → edited → written back is byte-for-byte identical; this invariant is pinned by a test.

The architectural greps (ci/checks.sh)

Dozens of invariants are enforced as build-failing greps — run pixi run checks and read the [check] lines, which are the list. (No number here on purpose: this page said “two” long after there were dozens. A count in prose is a claim nothing verifies.)

The two the seams rest on:

  1. Seam 1 — fm-query must not reference a database crate, std::fs, std::path, or File. The query engine physically cannot do I/O.
  2. Generic renderers — no todo|doing|done literal may appear under ui/src/renderers/**. Status names live only in data and CSS.

The rest cover the two git backends staying in step, the release archive’s contents, the iOS and Android shells, licence and font notices, the workflow triggers, and the documentation this manual is part of — including a check that every dispatch arm has a row in the command reference.

Run pixi run checks before committing a renderer or a query-engine change.

UI dev without a backend

pnpm -C ui dev (or the vitest suite) runs the UI against the in-memory mock in ui/src/lib/mock.ts — no server, no vault. import.meta.env.PROD selects the real HTTP backend only in the built bundle.