agentleFS
neijixneijix/AICodeFactory/skills/test-tiers/SKILL.md

test-tiers

Skill0 starsChanged 16 days agoMITView on GitHub

Use when a project's tests take more than ~5 minutes, the user says the tests are slow, take forever or an hour, before running a whole suite to check one change, in a fix loop that reruns a failing suite, or when setting up ./check.sh or CI for a project with integration, e2e, browser, GPU or network tests. Splits the gate into a fast default tier and ./check.sh --full, with targeted and last-failed runs, parallel workers, CI shards and per-framework markers.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    No marker mechanism fits → two scripts called by check.sh (tests/fast.sh, tests/full.sh), still behind the one --full flag.

    line 67

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Test tiers

./check.sh runs at the end of every response. A gate that takes an hour is either skipped (nothing is checked) or blocks the session for an hour: both are bugs. The default gate stays under ~5 minutes; everything slower moves to a full tier that runs less often, never away.

What to run when

MomentRun
Iterating on a changeOnly the tests of the code you touched (file, module, -k/-run filter)
Fixing a failing testThat test alone, then last-failed, then the fast tier — never the full tier per attempt
End of every response (commit)./check.sh — the fast tier
End of a feature, before a release, or a change to shared core (schemas, DB layer, config loader, build)./check.sh --full
CI on push./check.sh --full, sharded when it is still long

A full-tier run is a background job: start it once with the shell tool's maximum timeout, write its log to a unique file (/tmp/<project>-full-$$.log — parallel sessions share /tmp), keep working on something that doesn't touch the code under test, and read the result before calling the work done. Never start a second copy while one runs, and never rerun it to see whether a flaky test passes — fix or quarantine the flaky test.

Split the suite (once per project)

  1. Measure first. A few tests are usually most of the hour: pytest --durations=20, go test -json ./... (the Elapsed field), cargo nextest run (it prints slow tests), Jest --verbose. Typical causes, cheapest fix first: real sleeps and timeouts (fake the clock), a fresh DB or container per test (one per session, a transaction per test), live network calls (recorded fixtures — AGENTS.md Testing rule), a serial runner (workers), e2e tests repeating what unit tests already prove (delete the duplicate).
  2. Fast tier = lint, type check, code-health, unit tests: no network, no real browser, DB server or GPU, no sleeps. Full tier = fast tier + integration, e2e, browser, GPU or model, large fixtures, performance.
  3. Mark slow tests where they live — the framework's marker or a folder (tests/unit/ vs tests/integration/), never a list of file names inside check.sh.
  4. One gate, one flag. check.sh takes --full (its check.ps1 twin the same flag):
    #!/usr/bin/env bash
    set -euo pipefail
    full=0; [ "${1:-}" = "--full" ] && full=1
    # lint, type check, code-health …
    if [ "$full" = 1 ]; then uv run pytest -n auto; else uv run pytest -n auto -m "not slow"; fi
  5. Write the durations down in PROJECT_STATE.md Key Commands, so the next agent knows what it is starting: ./check.sh # fast tier, ~2 min and ./check.sh --full # + integration/e2e, ~50 min — CI, end of feature. Name the full tier in the AGENTS.md Testing rule and point CI (.github/workflows/check.yml) at it.

Per framework

FrameworkMark slowFast tierTargeted / last-failedParallel / shard
pytest@pytest.mark.slow, registered under markers in pyproject.toml-m "not slow"pytest tests/test_x.py -k name, --lf-n auto (pytest-xdist); --splits N --group i (pytest-split)
Jestseparate projects or an e2e/ path--testPathIgnorePatterns e2e--findRelatedTests <files>, --onlyFailuresworkers by default; --shard=i/N
Vitestseparate project or e2e/ path--exclude e2e/**vitest related <files>, --changedworkers by default; --shard=i/N
Goif testing.Short() { t.Skip(…) }go test -short ./...go test ./pkg/x -run TestYpackages run in parallel; t.Parallel()
Rust#[ignore]cargo testcargo test namecargo nextest run; full: -- --include-ignored
.NET (xUnit)[Trait("Category", "Slow")]dotnet test --filter "Category!=Slow"--filter "FullyQualifiedName~X"parallel by default
Pester-Tag SlowInvoke-Pester -ExcludeTagFilter SlowInvoke-Pester -Path tests/x.Tests.ps1separate jobs in CI
Numbered shell suite—a case list in the runnerrun-tests.sh <case>…one CI job per group

No marker mechanism fits → two scripts called by check.sh (tests/fast.sh, tests/full.sh), still behind the one --full flag.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.