agentleFS
LazyAGILazyAGI/LazyMind/tests/AGENTS.md

LazyMind / tests

AGENTS.md925 starsChanged 6 days agoApache-2.0View on GitHub

These rules apply to changes under tests/. They also document shared practices for tests colocated with application code and for CI changes; placing this file here does not automatically extend agent instruction scope to those directories. - Before adding or moving a test, check the owning module's test configuration, local command and actual CI command. A passing focused run does not prove CI collects the test. - Put algorithm tests in tests/algorithm/, not algorithm/tests/. Keep Go unit tests beside their…

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

13 rules. About 1 is common, 9 are distinctive, and 3 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before adding or moving a test, check the owning module's test configuration, local command and actual CI command.

    line 9
  2. Very specific:

    Put algorithm tests in tests/algorithm/, not algorithm/tests/.

    line 12
  3. Very specific:

    Check the scope of make test, module commands and CI separately.

    line 23
  4. Distinctive:

    Test real user paths, public results and important error handling.

    line 29
  5. Distinctive:

    Keep business logic, tool assembly and validation real.

    line 35
  6. Distinctive:

    Keep SDK transport, retry, timeout and error-handling coverage.

    line 40
  7. Distinctive:

    Prefer existing fake timers, events or controlled responses to fixed sleeps when testing asynchronous behavior.

    line 43
  8. Distinctive:

    After changing a fixture, run the affected tests with both supported database drivers and check that required branches still run.

    line 64
  9. Distinctive:

    Keep lint and documentation checks as prerequisites for test jobs.

    line 70
  10. Very specific:

    Do not assume a slow go test step means compilation is slow, or that printing ok means the command has finished.

    line 90
  11. Common:

    Remove temporary timing instrumentation after diagnosis.

    line 97
  12. Distinctive:

    Run lint and documentation checks before affected tests.

    line 100
  13. Distinctive:

    Keep performance targets separate from correctness requirements.

    line 103

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md 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
AGENTS.md

Testing and CI Development Rules

These rules apply to changes under tests/. They also document shared practices for tests colocated with application code and for CI changes; placing this file here does not automatically extend agent instruction scope to those directories.

Test placement and execution

  • Before adding or moving a test, check the owning module's test configuration, local command and actual CI command. A passing focused run does not prove CI collects the test.
  • Put algorithm tests in tests/algorithm/, not algorithm/tests/. Keep Go unit tests beside their packages and cross-module Core integration tests in tests/backend/core/.
  • Frontend component and hook tests belong beside their code under frontend/src/. tests/frontend/ is a separate suite with its own dependencies and collection rules. Check which suite and Vitest configuration a CI job runs; a dedicated configuration may collect only a subset of application tests.
  • Reuse the owning module's existing test entry point. If a required regression test is outside CI collection, update the relevant collection or entry point with the change. Do not move tests into an unrelated suite merely to make CI discover them.
  • Check the scope of make test, module commands and CI separately. Do not describe a local entry point as equivalent to the complete CI matrix without verifying its coverage.

Observable behavior and external boundaries

  • Test real user paths, public results and important error handling. Preserve assertions about permissions, state transitions and submitted parameters; avoid tests that only inspect source text or repeat the implementation.
  • In ordinary unit tests, fake unrelated external service calls at the existing client boundary using the module's current mocking tools. Return data that matches the scenario, including resource IDs and revisions where relevant.
  • Keep business logic, tool assembly and validation real. Do not mock the function whose behavior the test is intended to verify.
  • A request that times out and falls back is still an external request. Check for unexpected HTTP calls when investigating slow tests; a passing assertion alone does not prove the test is isolated.
  • Keep SDK transport, retry, timeout and error-handling coverage. Tests intended to exercise HTTP should use controlled local or mocked endpoints; real-service integration tests must have explicit setup and execution requirements.
  • Prefer existing fake timers, events or controlled responses to fixed sleeps when testing asynchronous behavior. Do not shorten production timeouts or disable retries to accelerate unrelated unit tests.

Database fixtures

  • Reuse existing domain fixtures and orm.MigrateTestDB. Before reducing a model list, trace the full handler or service call chain, including related queries, reconciliation and background work reached by the test.
  • Include tables inspected through HasTable or similar optional-schema checks when their behavior belongs to the scenario. Missing tables must not silently bypass the business behavior being tested.
  • Ordinary business tests should initialize their required models. Avoid full-model initialization and repeated AutoMigrate calls when a suitable domain fixture already provides the required schema.
  • Complete migration, schema-contract and genuinely full-application tests must retain the complete schema they verify. Do not replace migration-path verification with ORM AutoMigrate; follow the migration rules for migration changes.
  • Preserve independent SQLite databases or PostgreSQL schemas and cleanup for each test. Do not share mutable databases across tests to reduce setup time.
  • After changing a fixture, run the affected tests with both supported database drivers and check that required branches still run. Investigate missing-table errors even if the final test result passes through a fallback.

CI dependencies, coverage and caching

  • Keep lint and documentation checks as prerequisites for test jobs. Do not remove these dependencies to start tests earlier.
  • Preserve required test suites, database variants, platform coverage, migration verification, coverage reports and coverage thresholds. Do not gain speed by deleting scenarios, adding skips or weakening assertions and quality gates.
  • Reuse existing dependency download caches and compatible build artifacts before introducing another cache or installation step. Cache keys must account for the inputs that determine compatibility, such as platform, runtime, dependency files and source revision for locally built packages.
  • Distinguish download caches, build caches and test-result caches. A restored cache or a passing run does not by itself prove the expected work was reused. Diagnose restore keys, exact hits, saves and invalidation before changing the cache strategy. Never reuse stale artifacts or results across incompatible inputs.

Performance diagnosis and verification

  • Measure before changing execution structure. Separate queueing, dependency installation, compilation, linking, database setup, seeding, requests, test execution, cleanup and cache finalization where they contribute to the delay.
  • Do not assume a slow go test step means compilation is slow, or that printing ok means the command has finished. Use available timing output, pytest --durations, Go JSON events, build activity and cache diagnostics as needed.
  • Compare the same suites and instrumentation on comparable platforms. Record source revisions, commands and cold or warm cache state; distinguish measured change from runner variation and queueing. Assess overall duration through the critical path rather than adding parallel package or job times.
  • Remove temporary timing instrumentation after diagnosis. Keep permanent diagnostics only when they have a continuing purpose, preserve failure exit codes and avoid exposing credentials or business data.
  • Run lint and documentation checks before affected tests. Broaden validation to the relevant database and platform suites when fixture or CI changes require it. Do not repeatedly trigger unchanged full CI runs for more measurements.
  • Keep performance targets separate from correctness requirements. Report remaining bottlenecks and unverified limits without claiming a target has been reached. Report validation and timing results outside the PR description, which is reserved for the functional change.

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.