Skip to content

test(compat): scaffold cross-implementation compat-test harness#1249

Merged
mergify[bot] merged 1 commit intomainfrom
devs/jd/worktree-rust-port/scaffold-cross-impl-compat-test-harness--011cf832
Apr 21, 2026
Merged

test(compat): scaffold cross-implementation compat-test harness#1249
mergify[bot] merged 1 commit intomainfrom
devs/jd/worktree-rust-port/scaffold-cross-impl-compat-test-harness--011cf832

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented Apr 20, 2026

Adds the infrastructure that Phase 1+ of the Rust port will use to
verify the two implementations produce identical observable
behavior. During Phase 0 it runs Python against itself, which
already catches output drift and locks in the exit-code contract.

What's here

  • compat-tests/ at the repo root, kept separate from
    mergify_cli/tests/ so it can grow into a cross-implementation
    runner without polluting the unit-test tree.
  • compat-tests/test_compat.py — pytest-discovered runner that
    iterates compat-tests/cases/<case-name>/ directories and
    invokes python -m mergify_cli with the fixture's args. Asserts
    the exit code matches expected_exit and the optional
    stdout_contains substring appears in stdout.
  • Four seed fixtures exercising zero-state paths: --help,
    --version, unknown subcommand (exit 2), and stack --help.
  • mergify_cli/__main__.py so python -m mergify_cli works.
    This is what the Rust port's Python shim will invoke once the
    port lands.
  • poe compat-test task and a dedicated CI job so the harness
    runs on every PR.

What this doesn't do yet

Fixtures needing mocked HTTP or prepared git state aren't included
— they need additional harness support (env/stdin wiring, maybe a
fixtures-as-conftest layer). Those land incrementally as the Rust
port progresses; each new ported command gets at least one compat
fixture covering its observable contract.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

@jd
Copy link
Copy Markdown
Member Author

jd commented Apr 20, 2026

This pull request is part of a Mergify stack:

# Pull Request Link
1 test(compat): scaffold cross-implementation compat-test harness #1249 👈
2 feat(rust): scaffold Cargo workspace and Rust CI #1263
3 feat(rust): add mergify-py-shim with embedded Python fallback #1272
4 feat(rust): add mergify-core foundation types (Phase 1.2a) #1280
5 feat(rust): add mergify-core::http with retry + typed errors (Phase 1.2b) #1281
6 feat(rust): port config validate to native Rust (Phase 1.3) #1282

@mergify mergify Bot had a problem deploying to Mergify Merge Protections April 20, 2026 11:36 Failure
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 20, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=ci-gate

🟢 👀 Review Requirements

Wonderful, this rule succeeded.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?:

🟢 🔎 Reviews

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

@mergify mergify Bot requested a review from a team April 20, 2026 11:42
@jd jd force-pushed the devs/jd/worktree-rust-port/scaffold-cross-impl-compat-test-harness--011cf832 branch from 8858672 to 260a37d Compare April 20, 2026 12:53
@jd jd force-pushed the devs/jd/worktree-rust-port/formalize-json-stdout-stderr-discipline--5a37d5c1 branch from a2e8e33 to e03dc48 Compare April 20, 2026 12:53
@jd
Copy link
Copy Markdown
Member Author

jd commented Apr 20, 2026

Revision history

# Type Changes Date
1 initial 8858672 2026-04-20 12:53 UTC
2 rebase 8858672 → 260a37d 2026-04-20 12:53 UTC
3 rebase 260a37d → b5f2dfe 2026-04-20 13:15 UTC
4 rebase b5f2dfe → a651c13 2026-04-20 16:33 UTC
5 rebase a651c13 → 6703ebf 2026-04-21 08:00 UTC
6 content 6703ebf → 6d6d0c0 2026-04-21 09:10 UTC

@mergify mergify Bot had a problem deploying to Mergify Merge Protections April 20, 2026 12:53 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/scaffold-cross-impl-compat-test-harness--011cf832 branch from 260a37d to b5f2dfe Compare April 20, 2026 13:15
@mergify mergify Bot had a problem deploying to Mergify Merge Protections April 20, 2026 13:16 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/scaffold-cross-impl-compat-test-harness--011cf832 branch from b5f2dfe to a651c13 Compare April 20, 2026 16:33
@mergify mergify Bot had a problem deploying to Mergify Merge Protections April 20, 2026 16:34 Failure
Base automatically changed from devs/jd/worktree-rust-port/formalize-json-stdout-stderr-discipline--5a37d5c1 to main April 21, 2026 07:59
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 21, 2026

@jd this pull request is now in conflict 😩

@mergify mergify Bot added the conflict label Apr 21, 2026
Copilot AI review requested due to automatic review settings April 21, 2026 08:00
@jd jd force-pushed the devs/jd/worktree-rust-port/scaffold-cross-impl-compat-test-harness--011cf832 branch from a651c13 to 6703ebf Compare April 21, 2026 08:00
@mergify mergify Bot had a problem deploying to Mergify Merge Protections April 21, 2026 08:00 Failure
@mergify mergify Bot removed the conflict label Apr 21, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an initial “compat-tests” harness to lock in the Python CLI’s observable behavior (exit codes + selected stdout substrings) as groundwork for a future Rust implementation parity runner.

Changes:

  • Add compat-tests/ pytest runner that discovers case directories and executes python -m mergify_cli.
  • Add seed compat fixtures for basic, zero-state CLI behaviors (--help, --version, unknown command, stack --help).
  • Wire the harness into developer tooling (poe compat-test) and CI, and add mergify_cli/__main__.py to support python -m mergify_cli.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pyproject.toml Adds Ruff per-file ignores for the new compat test tree.
poe.toml Adds a compat-test Poe task to run the compat test suite.
mergify_cli/main.py Enables module execution via python -m mergify_cli.
compat-tests/test_compat.py Implements the compat case discovery + subprocess runner and assertions.
compat-tests/README.md Documents how to add/run compat cases and the purpose of the harness.
compat-tests/cases/** Adds initial compat test fixtures (args/expected exit/stdout substring).
.github/workflows/ci.yaml Adds a dedicated CI job to run compat tests on every PR and gates CI on it.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread compat-tests/test_compat.py
Comment thread mergify_cli/__main__.py Outdated
Comment thread compat-tests/README.md Outdated
Comment thread compat-tests/README.md Outdated
@jd jd marked this pull request as ready for review April 21, 2026 09:03
Adds the infrastructure that Phase 1+ of the Rust port will use to
verify the two implementations produce identical observable
behavior. During Phase 0 it runs Python against itself, which
already catches output drift and locks in the exit-code contract.

## What's here

- ``compat-tests/`` at the repo root, kept separate from
  ``mergify_cli/tests/`` so it can grow into a cross-implementation
  runner without polluting the unit-test tree.
- ``compat-tests/test_compat.py`` — pytest-discovered runner that
  iterates ``compat-tests/cases/<case-name>/`` directories and
  invokes ``python -m mergify_cli`` with the fixture's args. Asserts
  the exit code matches ``expected_exit`` and the optional
  ``stdout_contains`` substring appears in stdout.
- Four seed fixtures exercising zero-state paths: ``--help``,
  ``--version``, unknown subcommand (exit 2), and ``stack --help``.
- ``mergify_cli/__main__.py`` so ``python -m mergify_cli`` works.
  This is what the Rust port's Python shim will invoke once the
  port lands.
- ``poe compat-test`` task and a dedicated CI job so the harness
  runs on every PR.

## What this doesn't do yet

Fixtures needing mocked HTTP or prepared git state aren't included
— they need additional harness support (env/stdin wiring, maybe a
fixtures-as-conftest layer). Those land incrementally as the Rust
port progresses; each new ported command gets at least one compat
fixture covering its observable contract.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Change-Id: I011cf8321173c94fb46e8e6421b66534dc862813
@jd jd force-pushed the devs/jd/worktree-rust-port/scaffold-cross-impl-compat-test-harness--011cf832 branch from 6703ebf to 6d6d0c0 Compare April 21, 2026 09:10
@mergify mergify Bot deployed to Mergify Merge Protections April 21, 2026 09:11 Active
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 21, 2026

Merge Queue Status

  • Entered queue2026-04-21 13:11 UTC · Rule: default
  • Checks skipped · PR is already up-to-date
  • Merged2026-04-21 13:11 UTC · at 6d6d0c0bef39fef440dd23c14655d6bbcea7bebe · squash

This pull request spent 10 seconds in the queue, including 2 seconds running CI.

Required conditions to merge

@mergify mergify Bot added the queued label Apr 21, 2026
@mergify mergify Bot merged commit b314393 into main Apr 21, 2026
21 checks passed
@mergify mergify Bot deleted the devs/jd/worktree-rust-port/scaffold-cross-impl-compat-test-harness--011cf832 branch April 21, 2026 13:11
@mergify mergify Bot removed the queued label Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants