Skip to content

docs(tests): encode the test module marker rule (tm006) - #4303

Merged
Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-test-marker-rules
Nov 20, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-test-marker-rules

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

Writes the test module marker rule (tm006) into the tests instructions instead of broadcasting it. The new section "Test module markers (tm006)" in .apm/instructions/tests.instructions.md covers:

  • a copy-paste pytestmark template with a behavioral marker and pytest.mark.promise(...);
  • how to pick the behavioral marker (unit, component or e2e, chosen by the boundary the tests cross) and the promise ids (tests/quality/promise-catalog.json; spec modules use req-* ids);
  • the local check: uv run --extra dev pytest -p no:cacheprovider -q tests/quality/test_test_taxonomy.py;
  • the merge-conflict rule: never resolve a modify/delete by dropping main's tests.

The apm-lifecycle-tests skill and the test-coverage-expert agent now point to this section in one line each, instead of restating the rule. The generated copies (.agents/skills/..., .github/instructions/..., .github/agents/...) and their apm.lock.yaml content hashes are updated to match.

python -m tests.quality.taxonomy --changed is deliberately not documented yet; it lands with that command in a later slice.

Issue and approved scope

Issue: Refs #4113

Human scope-approval comment: assigned by the Stream T lead under the steward ruling on the maintainer's request to encode the test-marker rule (docs/instructions only).

Does this PR complete the issue, or what remains? Partial. The --changed local check, and gate messages that suggest marker and promise values, land with that command in a later slice.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally: uv run apm audit --ci passes all 11 checks (no drift, content integrity clean).
  • All existing tests pass (not run: no code or test changes).
  • Added tests for new functionality (if applicable)

Note: apm install refuses to redeploy on current main because .agents/skills/apm-lifecycle-tests/* has no trustworthy local deployment baseline. That predates this PR. The three generated files were updated byte-for-byte from their sources (the agent copy keeps its rewritten link), and only their three lockfile hashes changed.

Changelog

  • One line in one section under ## [Unreleased] in CHANGELOG.md
  • N/A -- internal-only change (contributor instructions).

Spec conformance (OpenAPM v0.1)

Not applicable: no behavior change.

…instructions

Adds a short "Test module markers (tm006)" section: the pytestmark
template, how to choose the behavioral marker and the promise ids, the
local check, and the merge-conflict rule for modify/delete on tests. The
apm-lifecycle-tests skill and the test-coverage-expert agent point to it.
Generated copies and their lockfile hashes are updated to match.

Part of #4113

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The test-instruction template fails collection because it requires an unregistered promise marker under strict-marker enforcement and references a missing promise catalog.

1 open issue
What changed in this PR

This documentation-only PR centralizes the test module marker guidance in APM’s contributor instructions and points the lifecycle skill and coverage-review agent to it. It does not change runtime or test behavior.

Changes:

  • Adds a pytestmark template, marker-selection guidance, a local taxonomy check, and a merge-conflict rule.
  • Replaces repeated guidance with references to the canonical section.
  • Updates generated copies and their lockfile content hashes.
File Description
apm.lock.yaml Updates hashes for the three changed generated files.
.github/​instructions/​tests.instructions.md Mirrors the new test module marker guidance.
.github/​agents/​test-coverage-expert.agent.md Adds the canonical marker-guidance reference.
.apm/​skills/​apm-lifecycle-tests/​SKILL.md Replaces inline marker guidance with a canonical reference.
.apm/​instructions/​tests.instructions.md Defines the central marker instructions and local check.
.apm/​agents/​test-coverage-expert.agent.md Directs coverage reviews to the central instructions.
.agents/​skills/​apm-lifecycle-tests/​SKILL.md Mirrors the lifecycle skill’s reference change.

Review effort: Balanced

Comment thread .apm/instructions/tests.instructions.md Resolved
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 3041bb8 into main Nov 20, 2026
30 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-test-marker-rules branch November 20, 2026 12:27
Takeshi Masukawa (takeaship) pushed a commit to takeaship/apm that referenced this pull request Nov 20, 2026
The tm006 template documented in microsoft#4303 uses pytest.mark.promise, which
--strict-markers rejects on main until the marker is registered. Same
wording and position as microsoft#4142, so the two merge cleanly.

Refs microsoft#4113

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
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.

2 participants