Repository navigation
docs(skills): add a write-tests skill that picks each test's layer - #14172
Merged
Merged
Conversation
Add a write-tests skill that names a behavior's owner, searches every layer for existing coverage, picks unit, contract, integration, or live E2E, prefers tofu test scenarios over Rust tests, and keeps live E2E to successful paths. Point test-driven-development, AGENTS.md, and testing.md at it, and drop a stale Spark test reference. Refs #14060 Signed-off-by: San Dang <[email protected]>
Collaborator
Author
Authoring session — opening
|
Contributor
7 tasks
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.
Failure
No skill says which layer a new test belongs in.
test-driven-developmentcovers writing a failing test first, andtest-desiderata-reviewaudits existing tests, but neither tells an agent to choose between unit, contract, integration, and live E2E tests, to prefertofu testscenarios over Rust tests, or to check for coverage another layer already owns. The #14060 migration repeatedly removed tests that a lower layer already covered, and live tests that injected failures a fixture could simulate.Decision
Add a
write-testsskill. It has the agent:tofu testscenario at each layer, and use Rust only for whattofu testcannot express: expected provider errors, SDK and CLI behavior, saved plans, interrupts, cancellation, state edits, a mid-test destroy, or a changed document on the same deployment.references/tofu-test.mdrecords the harness and the OpenTofu 1.12 limits found during #14060: run references only in variables, per-module run outputs, cleanup reusing the last applying run's variables, plan-time data reads, tuples versus lists, andexpect_failures.test-driven-development,AGENTS.md, and the "Write Tests" section ofdocs/contributing/testing.mdpoint to the skill;testing.mdgains a short list of the layers. It also drops a reference to the Spark live test that #14142 deleted.Part of #14060.
Validation
hcl/andfailures/directories of each provider,tests/integration/hclandrust/,tests/e2e/hclandrust/, the harness'spermit_destroyandbaseline, and the contract modules'destroying.cargo run -p nemoclaw-build -- fern check: 0 errors.