agentleFS
localtaskrepolocaltaskrepo/lotar/.github/skills/testing-strategy/SKILL.md

testing-strategy

Skill2 starsChanged 33 days agoMITView on GitHub

Choose meaningful behavior checks and run targeted Rust, UI, or smoke tests before the required final gates; includes low-noise commands.

59 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use api-contract-design, deploy-checklist and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MohOneXSkill

    api-contract-design

    Designs and reviews API contracts (REST, RPC, GraphQL, library interfaces) for evolvability, backward compatibility, and failure semantics. Use when defining new endpoints/interfaces, versioning an API, reviewing a schema, or deciding how breaking changes propagate to clients.

    Also in 3 projects that use this

  • AnthropicSkill

    deploy-checklist

    Pre-deployment verification checklist. Use when about to ship a release, deploying a change with database migrations or feature flags, verifying CI status and approvals before going to production, or documenting rollback triggers ahead of time.

    Also in 4 projects that use this

  • xenitV1Skill

    react-patterns

    Modern React patterns and principles. Hooks, composition, performance, TypeScript best practices.

    Also in 4 projects that use this

  • AnthropicSkill

    tech-debt

    Identify, categorize, and prioritize technical debt. Trigger with "tech debt", "technical debt audit", "what should we refactor", "code health", or when the user asks about code quality, refactoring priorities, or maintenance backlog.

    Also in 4 projects that use this

  • SentrySkill

    feature-flags

    Gate a Sentry feature behind a FlagPole feature flag. Use when adding a feature flag, registering a flag in temporary.py, checking a flag from Python or the frontend, enabling a flag in tests, or asking where FlagPole rollout config lives. Trigger on "add a feature flag", "gate this behind a flag", "register a flag", "features.has", "api_expose", "OrganizationFeature", "ProjectFeature", "FlagPole".

    Also in 3 projects that use this

  • MicrosoftSkill

    error-handling

    统一错误处理系统。在添加 API 端点、修改错误处理、添加前端 API 调用、编写错误相关测试时使用。

    Also in 5 projects that use this

  • +2 more from anthropics

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 47 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Start with the affected behavior (one failing test or file), then run the applicable final gates in AGENTS.md: in a fix, rework or review …

    line 8
  2. Distinctive:

    Test observable behavior at an existing public boundary with independent expected values, not private implementation structure or …

    line 17
  3. Very specific:

    Don't narrow Rust runs with -p lotar-lib: its tests run the lotar binary of the root package, which only a workspace run rebuilds.

    line 52
  4. Very specific:

    If smoke fails on environment/binary/server issues, switch to the smoke-suite-debugging skill.

    line 72
  5. Distinctive:

    Prefer these commands with ANSI disabled and compact reporters:

    line 76

“Common” is measured: kept by at least 6 in 10 of the 47 edited versions of this file we could read. “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

Strategy

  • Start with the affected behavior (one failing test or file), then run the applicable final gates in AGENTS.md: in a fix, rework or review job, lint and the tests for what changed (a filter, a file, the touched crate); the merge runs the full suites once (DEV-797). Repeat successful checks only for subsequent changes, failures, or unresolved risks.
  • For a bug, reproduce its actual symptom with a focused failing test or command before fixing when feasible. Minimize inputs, test a falsifiable hypothesis, and remove temporary instrumentation. If reproduction is unavailable, state the evidence and limitation instead of blocking all useful analysis.
  • Test observable behavior at an existing public boundary with independent expected values, not private implementation structure or tautological assertions. For test-first work, implement one failing behavior, make it pass, then proceed to the next slice. Ask about a testing boundary only when it changes the agreed design, not as a mandatory gate before every test.
  • Tests remove every temp file and folder they create. npm run test:rust, test:ui and the smoke suite run with a fresh temp folder and fail when anything is left in it (scripts/rust-test-runner.mjs, scripts/vitest-temp-guard.mjs; the vitest guard ignores Chromium's own .org.chromium.Chromium.* files).
  • One full run per machine at a time (DEV-784): a full Rust, UI or smoke run and lotar's merge checks take the machine's check lock, port 47586 (scripts/check-lock.mjs), and print Waiting for the machine's check lock ..., held by <run> while another holds it. That wait is not a hang. Runs filtered by file, test name or nextest filter don't wait, so iterate with them.
  • Wall-clock tests run serially (DEV-785): the nextest wall-clock test-group (.config/nextest.toml, max-threads = 1, started first) and the WALL_CLOCK_SPECS lists in view/vitest.config.ts and smoke/vitest.config.ts (a wall-clock project that runs one file at a time after the parallel files). A test that waits on real time or flakes under load goes there: add its module or exact name to the nextest filter, or its spec file to the list.
  • Pure documentation needs link/example/consistency checks. Run executable examples in isolated temporary workspaces. Embedded prompts and behavioral configuration need relevant behavior checks even when their files are Markdown.

Rust (nextest)

  • Full (--cargo-profile dev, the same build npm run build:smoke makes; CI uses ci): npm run test:rust (runtime Git probe: default profile when Git works, else the gitless profile with reported git_required exclusions — see tests README)
  • Filter by substring: npm run test:rust -- <substring>
  • Integration tests build into one binary (crates/lotar-lib/tests/integration.rs, DEV-302); each crates/lotar-lib/tests/<file>.rs is a module, so test names start with the file name. Select one file with -E 'test(/^<file>::/)', and list new test files in crates/lotar-lib/tests/integration.rs.
  • List exact test names: cargo nextest list --cargo-profile dev
  • Pass-through test-binary args (e.g. --nocapture): cargo nextest run --cargo-profile dev <filter> -- --nocapture
  • Pass --cargo-profile dev to raw nextest too: without it cargo uses its test profile, which builds every dependency once more (about 2 GB) instead of reusing the dev build (DEV-579).
  • Raw nextest (no npm runner) still selects git_required tests; they fail closed via require_git() when Git is unavailable — never a silent pass.
  • Fast clippy-only loop (lib+bins, no --all-targets/--all-features): npm run lint:backend:fast
  • npm run test:rust and test:rust:agent run npm run build:web first; include_dir! (crates/lotar-web-assets) requires the generated target/web-embed directory. In a fresh worktree run npm run build:web yourself before other cargo commands (raw nextest, clippy).
  • Don't narrow Rust runs with -p lotar-lib: its tests run the lotar binary of the root package, which only a workspace run rebuilds. Filter with -E instead.
  • The tests of crates/lotar-core (DEV-499), crates/lotar-tasks and crates/lotar-agent (DEV-634) run no binary, so -p works for them: cargo nextest run --cargo-profile dev -p lotar-agent builds that crate and the ones below it. Agent and automation tests that need only the services go in crates/lotar-agent (unit tests, or tests/ modules listed in tests/integration.rs, or in tests/windows_regressions.rs when the Windows CI job must run them); those that run the lotar binary or REST stay in crates/lotar-lib/tests.
  • Sandbox denial is not a code failure: when cargo stops before compiling with sccache (the rustc-wrapper in ~/.cargo/config.toml) and Operation not permitted, the agent sandbox blocked the cache server. Rerun the same command with the harness's approval for unsandboxed execution; if that is refused, rerun it with RUSTC_WRAPPER= (empty disables the wrapper; a slower, uncached build). Report which retry ran.

UI unit tests (vitest)

  • Full: npm run test:ui
  • By name: npm run test:ui -- -t "<substring>"
  • Single file: npm run test:ui -- view/<path>/<file>.test.ts
  • Typecheck frontend and smoke: npm run lint:frontend; oxlint + ESLint (Vue templates): npm run lint:js; Prettier check: npm run fmt:js:check

Smoke (Playwright + vitest harness)

  • Full (builds first): npm run smoke
  • Quick (no rebuild — assumes fresh artifacts): npm run test:smoke:quick
  • By name: npm run test:smoke:quick -- -t "<substring>"
  • By file: npm run test:smoke:quick -- smoke/tests/<suite>.smoke.spec.ts
  • Serialized watch loop: npx vitest watch --config smoke/vitest.config.ts --maxWorkers=1 --maxConcurrency=1 --no-file-parallelism
  • Install browsers if missing: npm run playwright:install

If smoke fails on environment/binary/server issues, switch to the smoke-suite-debugging skill.

Low-noise output (agent / CI logs)

Prefer these commands with ANSI disabled and compact reporters:

  • Lint: npm run lint:agent
  • Rust + UI tests: npm run test:agent
  • Rust-only: npm run test:rust:agent
  • UI-only: npm run test:ui:agent
  • Smoke (builds): npm run test:smoke:agent · quick: npm run test:smoke:quick:agent

These can satisfy the corresponding final gates when run without filters; do not rerun the noisy variants solely for their names. One execution difference matters: test:rust:agent sets --retries 0, overriding configured nextest retries. A pass is sufficient; if it fails, inspect the failure and use the normal Rust command when configured retry behavior is relevant. Report flaky recovery, not a clean first pass. Quick smoke is for iteration with fresh artifacts, not a substitute for the build-first final smoke gate.

Behavioral testing and reproduction techniques adapted from AI Hero's tdd and diagnosing-bugs; see sources and license.

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.