Skip to content

docs(testing): scope the test-location rule — subsystem packages keep their suite in-package#1603

Open
anikinsasha wants to merge 1 commit into
danielmiessler:mainfrom
anikinsasha:docs/testingdoctrine-subsystem-package-tests
Open

docs(testing): scope the test-location rule — subsystem packages keep their suite in-package#1603
anikinsasha wants to merge 1 commit into
danielmiessler:mainfrom
anikinsasha:docs/testingdoctrine-subsystem-package-tests

Conversation

@anikinsasha

Copy link
Copy Markdown

TestingDoctrine rule 2 maps every test into the repo-root test/ tree, and the anti-patterns list bans co-location without qualification. That is right for the repo-root surface (hooks, skills, single-file tools) but leaves one shipped class with no home in the rule: self-contained subsystem packages — tool directories with their own package.json, in the current payload LIFEOS/TOOLS/TokenXray/ and LIFEOS/TOOLS/llcli/. A package with its own dependencies and lifecycle is the unit that travels; routing its suite into the repo-root tree strands the tests whenever the package is developed, vendored, or deployed on its own.

Changes (docs only, no behavior change):

  • Rule 2 gains a Subsystem-package clause: a directory-tool with its own package.json keeps its suite in-package at <tool>/test/ with a package.json test script — the suite travels with the deployable package. The parallel repo-root test/ tree continues to govern the repo-root surface.
  • The co-location anti-pattern row is scoped to match (repo-root surface only; subsystem packages keep in-package suites per Rule 2). A package-local test/ directory is the parallel-tree pattern at package scope, not co-location — co-location means a test file next to its source file.

Deliberately not touched: no test tree or harness is added (that packaging question is #1550's, whose resolution this clause is consistent with — the clause governs where tests live when they exist); no bunfig or code changes; rules 1 and 3–11 unchanged. The corpus coverage rule (every hook/skill/tool surface gets at least one test file) loses nothing — a repo-root bun test walk still reaches in-package suites.

We run this split on our install: two subsystem tools keep their suites in-package (a 14-file suite behind a bare bun test script; a second package whose script scopes unit tests apart from live-integration runners), run per-package, with the packages' deploy scripts shipping test/ alongside the code — tests traveling with the package is exactly what the clause writes down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant