Skip to content

Add cross-command dry-run contract tests#349

Merged
AndreyVMarkelov merged 1 commit into
masterfrom
feature/dry-run-contract-tests
Jul 9, 2026
Merged

Add cross-command dry-run contract tests#349
AndreyVMarkelov merged 1 commit into
masterfrom
feature/dry-run-contract-tests

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Introduces a canonical dryRunCommands registry and four cross-command contract tests that guard the dry-run conventions spanning all commands at once. This is the first PR in a series to generalize dry-run handling; it locks in current behavior before any refactor touches command code.

What it checks

  • Registry ↔ flags — the registry equals the set of structured-output commands that actually register --dry-run (catches both a new flag with no registry entry and a stale entry).
  • Planned statusplanned is allowed in both the contract metadata and the code-derived JSON schema.
  • Input schemadry_run appears in each command's published input schema.
  • Result input schemadry_run appears on each command's result input schema.

Why

Per-command tests already cover runtime behavior (planned JSON/text output and that no write API is called). What was missing is a net for the "forgot one of the coupled edits" failure — flag, schema, and status drifting apart across commands. These tests fail loudly when a dry-run command skips one of the conventions.

Introduce a canonical dryRunCommands registry and four contract tests
that guard the dry-run conventions spanning all commands at once:

- registry matches the set of structured-output commands registering
  --dry-run (both directions of drift)
- "planned" status is allowed in both contract metadata and the
  code-derived JSON schema
- dry_run appears in each command's published input schema
- dry_run appears on each command's result input schema

Per-command tests already cover runtime behavior (planned JSON/text
output and that no write API is called); this registry catches the
"forgot one of the coupled edits" failure across commands.
@AndreyVMarkelov AndreyVMarkelov merged commit c82edb8 into master Jul 9, 2026
13 checks passed
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