docs(testing): scope the test-location rule — subsystem packages keep their suite in-package#1603
Open
anikinsasha wants to merge 1 commit into
Conversation
… their suite in-package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ownpackage.json, in the current payloadLIFEOS/TOOLS/TokenXray/andLIFEOS/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):
package.jsonkeeps its suite in-package at<tool>/test/with apackage.jsontestscript — the suite travels with the deployable package. The parallel repo-roottest/tree continues to govern the repo-root surface.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 testwalk 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 testscript; a second package whose script scopes unit tests apart from live-integration runners), run per-package, with the packages' deploy scripts shippingtest/alongside the code — tests traveling with the package is exactly what the clause writes down.