Skip to content

docs: name the two kinds of test in scripts/, and ask which one a PR added - #563

Merged
PathGao merged 1 commit into
masterfrom
docs/test-policy
Aug 10, 2026
Merged

docs: name the two kinds of test in scripts/, and ask which one a PR added#563
PathGao merged 1 commit into
masterfrom
docs/test-policy

Conversation

@PathGao

@PathGao PathGao commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

What this is

Two documentation edits, no code and no test files touched.

  • AGENTS.md stops calling scripts/*.test.ts "the behavior tests" and names what is actually in there.
  • The pull request template's Tests section asks which kind you added, and says out loud that not every fix needs one.

Mechanism

The description in AGENTS.md dates from when the suite was small enough for it to be true. Counting the tree today: 109 test files, and 31 of them import nothing from src/ — they match the source text with a regex or an AST walk. Another 53 do both.

Both kinds are worth having, but they fail in opposite directions:

behaviour correct behaviour broken
spelling unchanged green ✓ green ✗ — the line is still there, the behaviour is not
spelling changed red ✗ — a rename that broke nothing red ✓

A source-shape assertion checks whether a line is still spelled a certain way. That is exactly right when the spelling is the contract and the compiler cannot see it — invoke('read_file_content') has to match a Rust function name, t('common.save') has to match a dictionary key, mermaid.render( must not acquire a third call site (singleImplementationConvention.test.ts exists for that). It is wrong when the anchor is an internal call, where a rename is free and pinning it makes ordinary refactoring fail the suite for no behavioural reason.

Calling the whole suite "behavior tests" hides that distinction, and the cost lands on the next reader — human or agent — who reads a green run as coverage it isn't.

Scope

Deliberately left alone:

  • No test files are added, changed or deleted. Whether any existing assertion should go is a separate question, one file at a time, and deleting tests is its own risk. This PR only makes the two kinds visible so that question can be asked.
  • No rule, no lint, no CI gate. The template opens with "Nothing below is required" and this section keeps that voice — it asks a question, it does not reject a PR.
  • AGENTS.md gets no methodology, only the corrected description. What counts as worth testing is a judgement that belongs in review, not in a file that mostly states facts about the build.

Tests

None, and none are possible: nothing in scripts/ reads AGENTS.md or the pull request template (grep -rln 'AGENTS.md\|PULL_REQUEST_TEMPLATE' scripts/ is empty). By the criterion this PR adds, a docs change with no silent failure mode does not get one.

Verification

Documentation only — no source file changes, so npm run check and cargo test have nothing new to see and CI runs them anyway. Both edited files were re-read in full after editing.

Not verified: how the template renders in GitHub's PR compose box. The added text is plain paragraphs inside an existing ## section, so it follows whatever the four sections above it already do.

🤖 Generated with Claude Code

…added

`npm test` has been described as "the behavior tests" since the suite was
three files. It is now 109, and 31 of them import nothing from `src/` —
they match the source text instead. Both kinds are useful, but they fail
differently: a source-shape assertion goes red on a rename that broke
nothing, and stays green on a change that broke something, because what
it checks is whether a line is still spelled a certain way.

Calling the whole suite behavior tests hides that, and the cost is a
reader — human or agent — treating a green run as coverage it isn't.

So AGENTS.md names both kinds, and the pull request template asks which
one you added and what its anchor is. Pinning a Tauri command name, an
i18n key or a duplicated implementation is what source-shape assertions
are for; pinning an internal call site is not. The template also says
out loud that not every fix needs a test, which nothing here said before.

No test files change. This is documentation of what the suite already is.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@PathGao
PathGao merged commit 90c4804 into master Aug 10, 2026
4 checks passed
@PathGao
PathGao deleted the docs/test-policy branch August 10, 2026 10:52
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