From 9335c51d86de7c9f2ce204aef7bff56ad5bafc79 Mon Sep 17 00:00:00 2001 From: R0ck Date: Thu, 17 Sep 2026 17:23:34 +0100 Subject: [PATCH] docs(agents): finish moving test commands to tests/unit and tests/e2e Review follow-up on the test move: - AGENTS.md "Test Files": drop the seven Node-era suites and the two tools/ scripts that no longer exist, and lead with test-all.sh. - .squad bishop and newt charters: point at tests/unit and tests/e2e, and drop the same removed suites and tools. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01SJZ75CWob1eMXeTa8Q2nLc --- .squad/agents/bishop/charter.md | 14 ++++++-------- .squad/agents/newt/charter.md | 2 +- AGENTS.md | 12 ++---------- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.squad/agents/bishop/charter.md b/.squad/agents/bishop/charter.md index 09b0a5d8..5ce7d6fe 100644 --- a/.squad/agents/bishop/charter.md +++ b/.squad/agents/bishop/charter.md @@ -10,16 +10,15 @@ Unit tests, Playwright E2E, coverage gates, and quality assurance for CoreScope. ## Responsibilities -- Unit tests: test-packet-filter.js, test-aging.js, test-decoder.js, test-decoder-spec.js, test-server-helpers.js, test-server-routes.js, test-packet-store.js, test-db.js, test-frontend-helpers.js, test-regional-filter.js, test-regional-integration.js, test-live-dedup.js -- Playwright E2E: test-e2e-playwright.js (8 browser tests, default localhost:3000) -- E2E tools: tools/e2e-test.js, tools/frontend-test.js +- Unit tests: `tests/unit/`, all listed in `test-all.sh` (e.g. test-packet-filter.js, test-aging.js, test-frontend-helpers.js); Go tests under `cmd/` +- Playwright E2E: `tests/e2e/`, classified in `scripts/non-unit-tests.json` (e.g. test-e2e-playwright.js, default localhost:3000) - Coverage: Backend 85%+ (c8), Frontend 42%+ (Istanbul + nyc). Both only go up. - Review authority: May approve or reject work from Hicks and Newt based on test results ## Boundaries - Test the REAL code — import actual modules, don't copy-paste functions into test files -- Use vm.createContext for frontend helpers (see test-frontend-helpers.js pattern) +- Use vm.createContext for frontend helpers (see tests/unit/test-frontend-helpers.js pattern) - Playwright tests default to localhost:3000 — NEVER run against prod - Every bug fix gets a regression test - Every new feature must add tests — test count only goes up @@ -37,10 +36,9 @@ Unit tests, Playwright E2E, coverage gates, and quality assurance for CoreScope. npm test # all backend tests + coverage summary npm run test:unit # fast: unit tests only npm run test:coverage # all tests + HTML coverage report -node test-packet-filter.js # filter engine -node test-decoder.js # packet decoder -node test-server-routes.js # API routes via supertest -node test-e2e-playwright.js # 8 Playwright browser tests +sh test-all.sh # every suite in tests/unit +node tests/unit/test-packet-filter.js # filter engine +node tests/e2e/test-e2e-playwright.js # Playwright browser tests ``` ## Model diff --git a/.squad/agents/newt/charter.md b/.squad/agents/newt/charter.md index 223f424b..fc87a6f5 100644 --- a/.squad/agents/newt/charter.md +++ b/.squad/agents/newt/charter.md @@ -24,7 +24,7 @@ Vanilla JS UI, Leaflet maps, live visualization, theming, and all public/ module - Use shared helpers from roles.js (ROLE_COLORS, TYPE_COLORS, getNodeStatus, getHealthThresholds) - Prefer `n.last_heard || n.last_seen` for display and status - No per-packet API calls from frontend — fetch bulk, filter client-side -- Run `node test-packet-filter.js` and `node test-frontend-helpers.js` after filter/helper changes +- Run `node tests/unit/test-packet-filter.js` and `node tests/unit/test-frontend-helpers.js` after filter/helper changes - Always bump cache busters in the SAME commit as code changes ## Key Files diff --git a/AGENTS.md b/AGENTS.md index 7ccff911..badc8208 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -219,21 +219,13 @@ npm run test:full-coverage # backend + instrumented frontend coverage via Playw ### Test Files ```bash # Backend (deterministic, run before every push) +sh test-all.sh # every suite in tests/unit node tests/unit/test-packet-filter.js # filter engine node tests/unit/test-aging.js # node aging system -node test-regional-filter.js # regional observer filtering -node test-decoder.js # packet decoder -node test-decoder-spec.js # spec-driven + golden fixture tests -node test-server-helpers.js # extracted server functions -node test-server-routes.js # API route tests via supertest -node test-packet-store.js # in-memory packet store -node test-db.js # SQLite operations node tests/unit/test-frontend-helpers.js # frontend logic (via vm.createContext) -node tools/e2e-test.js # E2E: temp server + synthetic packets -node tools/frontend-test.js # frontend smoke: HTML, JS refs, API shapes # Frontend E2E (requires running server or Playwright) -node tests/e2e/test-e2e-playwright.js # 8 Playwright browser tests (default: localhost:3000) +node tests/e2e/test-e2e-playwright.js # Playwright browser tests (default: localhost:3000) ``` ### Rules