docs: mind the build machine and keep full test runs on CI
RULES.md gains "The machine you build on": check memory, load and running builds first, cap Cargo jobs and test threads, run at low priority, one heavy job at a time, stop when the person says the machine is slow, and clean up scratch targets. Locally only the test targets a change touches run; the full suite runs on GitHub before a release. AGENTS.md, CONTRIBUTING.md and the PR checklist say the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
## Checklist
|
||||
|
||||
- [ ] Tests first; new code is covered, error paths included
|
||||
- [ ] `cargo fmt --all`, `cargo clippy --all-targets` and `cargo test` pass
|
||||
- [ ] `cargo fmt --all`, `cargo clippy --all-targets` and the affected `cargo test --test` targets pass
|
||||
- [ ] Follows [RULES.md](../RULES.md) (no overflow, data safety, one undo step per tool call)
|
||||
- [ ] Docs, tool descriptions and `PROGRESS.md` updated where needed
|
||||
- [ ] Conventional commit messages
|
||||
|
||||
@@ -11,11 +11,19 @@ you is accountable for.
|
||||
cargo build --release
|
||||
cargo fmt --all
|
||||
cargo clippy --all-targets
|
||||
cargo test --no-fail-fast # prefer one test: cargo test --test mcp name
|
||||
cargo test --test incremental # only the targets your change touches
|
||||
cargo test --lib editor::changes # unit tests of one module
|
||||
cargo check --lib --target wasm32-unknown-unknown
|
||||
```
|
||||
|
||||
`tests/update.rs` cannot run on Windows (it needs elevation); that failure is known.
|
||||
Do not run the full suite locally: it builds dozens of test binaries. It runs on GitHub before
|
||||
each release (`.github/workflows/test.yml`). `tests/update.rs` cannot run on Windows outside CI
|
||||
(it needs elevation); that failure is known.
|
||||
|
||||
Builds run on the person's own machine, so mind its resources (RULES.md, "The machine you build
|
||||
on"): check free memory and running builds first, cap jobs at no more than half the cores
|
||||
(`cargo test -j 8 -- --test-threads=8` on 16 cores), run at low priority, run one heavy job at a
|
||||
time, and stop at once if they say it is slow.
|
||||
|
||||
## Running the app safely
|
||||
|
||||
|
||||
+5
-1
@@ -69,10 +69,14 @@ fetches from a public git repository at the revision pinned in `Cargo.toml`.
|
||||
```sh
|
||||
cargo fmt --all
|
||||
cargo clippy --all-targets
|
||||
cargo test --no-fail-fast
|
||||
cargo test --test <target> # the targets your change touches
|
||||
cargo check --lib --target wasm32-unknown-unknown # the web build
|
||||
```
|
||||
|
||||
Each file in `tests/` is its own binary linking the whole app, so the full suite is slow and heavy
|
||||
on a desktop. It runs on GitHub instead: before every release (`.github/workflows/test.yml`), or
|
||||
on demand with `gh workflow run test.yml -f ref=<branch>`.
|
||||
|
||||
Keep the tree free of the third-party branding patterns listed in `.debrand`.
|
||||
|
||||
### Tests
|
||||
|
||||
@@ -40,6 +40,28 @@ PaperCraft stores people's work. Treat that as the top priority.
|
||||
says so.
|
||||
* Destructive operations are undoable or confirmed.
|
||||
|
||||
## The machine you build on
|
||||
|
||||
A full build links dozens of test binaries and can take every core and most of the memory of a
|
||||
desktop. The person is still using that machine, often with PaperCraft open.
|
||||
|
||||
* **Look before you start a heavy job.** Check free memory, CPU load and what is already running
|
||||
(the person's app, another build, other agents) before a build, a test run or clippy. If memory
|
||||
is short or another build is running, wait or ask.
|
||||
* **Leave room.** Cap Cargo at no more than half the logical cores (`-j 8` on a 16-core machine,
|
||||
or `CARGO_BUILD_JOBS`) and the test harness too (`-- --test-threads=8`); go lower when memory is
|
||||
tight, since linking is the peak. Run heavy jobs at low priority (`nice` on Unix, Below Normal
|
||||
on Windows).
|
||||
* **One heavy job at a time.** Never run two builds side by side; each target folder is a full
|
||||
build's worth of compiling and linking. Parallel agents share one build slot.
|
||||
* **Run only what your change touches**: `cargo check` before `cargo build`, and the test
|
||||
targets that cover the change (`cargo test --test incremental`). The full suite runs on GitHub
|
||||
before a release (`.github/workflows/test.yml`), not on a desktop.
|
||||
* **Stop at once when the person says the machine is slow**, then check that no compiler, linker
|
||||
or test process of yours is left over.
|
||||
* **Clean up.** Delete scratch target folders and worktrees when the work is merged; they grow to
|
||||
tens of gigabytes.
|
||||
|
||||
## UI
|
||||
|
||||
* **Use the shared kit.** Controls, spacing, radii and colours come from `craft-ui`,
|
||||
|
||||
Reference in New Issue
Block a user