DocumentationDevelopment
Rust · 0.1.0
Testing
Use focused checks, then the gates affected by the change.
Local checks
Run focused tests while editing, then the applicable wider checks. The following are repository commands, not evidence that they passed for your checkout. Frontend checks run from web/. Generated protocol changes need their own lint and drift validation.
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked
cd web
pnpm lint
pnpm test
pnpm buildDatabase contracts are destructive
PostgreSQL and MySQL store contracts require a real isolated test database and explicit schema-reset authorization in the test environment. Never use production connection strings or a database you need to retain. SQLite tests alone do not establish network-database behavior; host tests alone do not establish container, ARM or Windows behavior.
Report the limits
Record the exact source revision, command and result. Distinguish passed, failed, skipped and not run. For UI work, check keyboard/mobile behavior, interrupted flows and repeated actions in addition to a happy path. No CI run is needed merely to generate these static docs.
Choose checks by the changed responsibility
A focused unit test is useful during editing, but completion requires the gates affected by the change. The aggregate backend check writes logs and also checks protocol/acceptance evidence; read its first failing stage rather than treating a later stage that never ran as passed.
| Change | Checks to include |
|---|---|
| Rust behavior | Formatting, Clippy, focused behavior tests and the workspace suite |
| Database behavior | SQLite plus relevant real PostgreSQL/MySQL contracts |
| Web UI | pnpm lint, pnpm test, pnpm build and browser flows |
| Protocol definitions | Buf lint/format/generate, generated diff and consumers' tests |
| Container or entrypoint | Entrypoint checks and the intended runtime-image/platform checks |
Run the aggregate backend check
Run from the repository root. The optional argument selects a log directory. This includes formatting, Clippy, workspace tests, driver-timeout tests, contract checks and acceptance comparators. A missing external prerequisite is a blocker to report, not a reason to remove the corresponding check.
bash scripts/rust/check.sh target/verificationOpt in to disposable network-database tests
These tests can drop the database schema. Use dedicated disposable PostgreSQL and MySQL databases with no real records, and supply their URLs through your own secret-handling mechanism as POSTGRES_TEST_URL and MYSQL_TEST_URL. The explicit reset flag is required by test-store.sh. The script runs the ignored network_ tests serially; ordinary workspace tests do not cover them.
: "${POSTGRES_TEST_URL:?Set the disposable PostgreSQL test database URL}"
AMEMOS_TEST_DATABASE_URL="$POSTGRES_TEST_URL" \
AMEMOS_TEST_ALLOW_SCHEMA_RESET=1 \
bash scripts/rust/test-store.sh postgres
: "${MYSQL_TEST_URL:?Set the disposable MySQL test database URL}"
AMEMOS_TEST_DATABASE_URL="$MYSQL_TEST_URL" \
AMEMOS_TEST_ALLOW_SCHEMA_RESET=1 \
bash scripts/rust/test-store.sh mysqlCheck browser flows and report what was exercised
For a UI change, identify a starting state, perform the task and verify the stored result after refresh. Include narrow screens and keyboard access, cancellation/back navigation, errors and repeated clicks where relevant. List the browsers and flows actually tested. Passing a build does not establish that an editor, dialog or mobile layout is usable.