S002: unit tests green (29 pass twice, no fixes needed)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-11 17:28:40 -06:00
commit 23e3061611
4 changed files with 16 additions and 9 deletions

View file

@ -63,7 +63,7 @@ Never modify: `~/Documents/Apps/Nacre` (the original Python Nacre, reference onl
| Tool | Role | Available after |
|---|---|---|
| `nice cargo build --release -j 2` | compile check, produces `target/release/nacre` | now |
| `cargo test` | unit tests (util, settings, history, bookmarks, permissions, vault, dns, bridge loopback, download, adblock, keys, scripts, updates, inject, hub, theme) | first successful build; not alongside a build |
| `nice cargo test --release -j 2` | unit tests (29, ~16 s test-profile build then <1 s run; shares the S001 build) (util, settings, history, bookmarks, permissions, vault, dns, bridge loopback, download, adblock, keys, scripts, updates, inject, hub, theme) | first successful build; not alongside a build |
| `src/selftest.rs` | in-app self test (smoke run) | check its current state first |
| Smoke test | launch offscreen, write status file and screenshots, look at them | first build |
| appimagetool, wine + Inno Setup, VM "Windows 10" | packaging and Windows checks | see the user's global CLAUDE.md "Building" |

View file

@ -11,13 +11,13 @@ Run the unit test suite for the first time and make it pass (CLAUDE.md §5 lists
- The test modules that fail, and the functions they test
## Steps
- [ ] Make sure no other cargo process runs (`pgrep -a cargo`); run `nice cargo test --release -j 2 --no-run 2>&1 | grep -E '^error' -A5 | head -150` and fix test-only compile errors
- [ ] Run `nice cargo test --release -j 2 2>&1 | grep -E 'test result|FAILED|panicked' ` and list failures
- [ ] For each failing test decide: bug in code (fix code) or wrong expectation (fix test, say why in the commit); fix them one module at a time
- [ ] Make sure no test touches the network beyond loopback, Tor, a proxy or the user's profile (grep tests for `http`, `tor`, `dirs::`); fix any that do
- [ ] Full suite green twice in a row (flaky check)
- [ ] Update CLAUDE.md §5 `cargo test` row with the real command and run time
- [ ] PROGRESS entry, INDEX line, commit `S002: …` and push
- [x] Make sure no other cargo process runs (`pgrep -a cargo`); run `nice cargo test --release -j 2 --no-run 2>&1 | grep -E '^error' -A5 | head -150` and fix test-only compile errors
- [x] Run `nice cargo test --release -j 2 2>&1 | grep -E 'test result|FAILED|panicked' ` and list failures
- [x] For each failing test decide: bug in code (fix code) or wrong expectation (fix test, say why in the commit); fix them one module at a time
- [x] Make sure no test touches the network beyond loopback, Tor, a proxy or the user's profile (grep tests for `http`, `tor`, `dirs::`); fix any that do
- [x] Full suite green twice in a row (flaky check)
- [x] Update CLAUDE.md §5 `cargo test` row with the real command and run time
- [x] PROGRESS entry, INDEX line, commit `S002: …` and push
## End criteria
- `nice cargo test --release -j 2` exits 0, twice in a row.

View file

@ -6,7 +6,7 @@ Tracker: https://claude.ai/artifact/9AD7fPfwJ4ASFzVTJGKU4h
## 01 First build
- [x] [S001 — Compile to a binary](01%20First%20build/S001-compile.md) · Opus medium
- [ ] [S002 — Unit tests green](01%20First%20build/S002-unit-tests.md) · Sonnet high
- [x] [S002 — Unit tests green](01%20First%20build/S002-unit-tests.md) · Sonnet high
- [ ] [S003 — First launch and smoke harness](01%20First%20build/S003-first-launch.md) · Opus medium
- [ ] [S004 — Phase 1 review with the user](01%20First%20build/S004-phase1-review.md) · Sonnet medium · 🧑

View file

@ -14,6 +14,13 @@ One entry per session, newest last, ≤ 15 lines: done, verified how, not done,
`keys::conflicts` (shortcut conflict check), `Command::SpellReplace` (duplicate of `MenuAction::SpellReplace`),
`tabs::Page::Error`, `Prompt::Info`. Worth a look in the gaps phase.
## S002 — Unit tests green (2026-11-11)
- Done: `nice cargo test --release -j 2` compiles with no test-only errors; 29 tests pass, run 0.1 s (build ~16 s).
Green twice in a row. No code or test changes were needed: no bugs found.
- Verified: grep of test modules: only temp dirs (adblock, vault), loopback TcpStream (bridge), `/nonexistent`
paths (history); URLs in tests are string constants. No test touches `~/.config/nacre*`, Tor or proxies.
- Not done: coverage is thin (29 tests across 16 modules; no tests for e.g. downloads dlm, session, apps).
## Later
- Reader mode, split view, translate, real gamepad rumble (D-002: not planned for now).
- Packaging and first release (D-001: plan when the user asks).