Skip to content

Document the test tiers so contributors can diagnose a red run #181

Done

Description

@w4ffl35

Problem

There is one test command (npm test, fail-fast over all src/**/*.test.ts via scripts/run-tests.mjs) and no documented tiers. Contributors cannot tell which failures need private staging (Fleet source), a Playwright browser download, or a GPU/Ollama, so a red run is undiagnosable. CI (.github/workflows/ci.yml) only runs on the private maintenance repo, so public contributors get no signal at all.

Architecture (independent solution)

Document and name the tiers that already exist implicitly; do not restructure the runner's discovery:

  1. Add a ## Testing section to CONTRIBUTING.md (and link from README.md Development table) defining: Tier 0 npx tsc --noEmit (no deps), Tier 1 npm test unit/fake tests (no network, no key), Tier 2 private Fleet integration (requires staged FLEET_SECURITY_WATCH_TEST_ROOT, see the companion skip issue), Tier 3 e2e shells (scripts/e2e/run.sh etc., mock OpenRouter), Tier 4 live/OpenShell/Playwright-browser checks (explicit opt-in, may need npx playwright install chromium).
  2. For each tier list: command, prerequisites, expected duration class, and what a failure means.
  3. Optionally add npm run test:unit -- alias only if it is a pure filter over the existing runner (node scripts/run-tests.mjs --filter ... already exists — document it, don't duplicate it).

Scope / non-goals

  • No runner rewrite, no new test framework, no CI changes.

Acceptance

  • A new contributor following only CONTRIBUTING.md can reach a green Tier 0+1 run and can explain any Tier 2 skip.
  • Every command in the doc was actually run and its output class verified.

Tests

Docs-only: verify each documented command verbatim. Declare happy/sad/bad as docs/config per testing standard (no code path).

Contributor notes

Good first issue: pure documentation verified by running commands. Coordinate with the Fleet-skip issue so wording matches its skip line.

Activity

  1. added
    documentation
    good first issue
    help wanted
    on Nov 29, 2026
  2. w4ffl35 commented on Dec 5, 2026

    @w4ffl35
    MemberAuthor

    Issue 181 — Closing Report

    Files changed

    • CONTRIBUTING.md (new ## Testing section: tiers 0–4 table with command, prerequisites, duration class, failure meaning + skip-line contracts + CI note)
    • README.md (Development table links to CONTRIBUTING.md Testing tiers)

    Baseline (before)

    No tier documentation existed (grep -n "Tier" CONTRIBUTING.md README.md empty). A red npm test gave no way to tell a Fleet-staging skip from a Playwright gap from a real regression.

    Baseline (after)

    • Tier 0 npx tsc --noEmit: exit 0, verified verbatim.
    • Tier 1 npm test / npm test -- <substring> / npx tsx <test-file>: full run run-tests: all 341 file(s) passed; npm test -- terminal → 4 files passed; npm test -- fleet-test-source → passed; bad filter → run-tests: no test files matched filter exit 1 (verified).
    • Tier 2 skip line verified verbatim: SKIP repository-budget-v2 integration: Fleet source not staged, exit 0; bogus-root hard error verified.
    • Tier 3 bash scripts/e2e/run.sh: exit 0, all 8 ok lines (dry-run mode loading, CLI exit 0, completion on stdout/log, worktree fix, fixture clean, mock >= 3 requests, history growth).
    • Tier 4: browser tests present in-tree and passing here (Chromium binaries installed); documented the exact skip line for machines without them. Docs-only, no runner changes.

    Boot check

    N/A (docs-only). npx tsc --noEmit clean; full npm test green as above. Every command in the table was run verbatim and its output class confirmed.

    Residual risk / notes

    CI runs only on the private maintenance repo, so the Tier table asks public contributors to trust the documented skip lines without a CI signal of their own. If the skip wording ever changes, CONTRIBUTING.md must change with it — consider a grep test pinning the exact lines as a follow-up.

    PR: #204

  3. added a commit that references this issue on Dec 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationgood first issuehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions