Skip to content

test(skill): port the skill-references test to Rust#1414

Open
jd wants to merge 1 commit into
devs/jd/worktree-rust-port/port-queue-show-native-rust--6c265303from
devs/jd/worktree-rust-port/port-skill-refs-test-rust--7eb5e384
Open

test(skill): port the skill-references test to Rust#1414
jd wants to merge 1 commit into
devs/jd/worktree-rust-port/port-queue-show-native-rust--6c265303from
devs/jd/worktree-rust-port/port-skill-refs-test-rust--7eb5e384

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented May 12, 2026

Replaces mergify_cli/tests/queue/test_skill.py with a Rust
integration test in crates/mergify-cli/tests/skill_references.rs.

The test validates two artifacts with no Python in the picture:

  • The skills/mergify-merge-queue/SKILL.md Markdown file
    (frontmatter shape, required sections).
  • The Rust binary's --list-native-commands output (every
    mergify queue <cmd> reference in the skill must resolve to
    a native command).

Keeping the test in pytest meant carrying Python plumbing for a
language-agnostic concern. The Rust port:

  • spawns the binary via CARGO_BIN_EXE_mergify (the artifact
    cargo test just built), so the test always exercises the
    current code rather than whatever mergify happens to be on
    PATH;
  • reads the skill file via CARGO_MANIFEST_DIR-relative
    resolution, so it's robust to the cwd;
  • adds two dev-deps to mergify-cli (regex for the
    frontmatter / reference patterns, serde_yaml_ng for
    frontmatter parsing — already used by mergify-ci).

The mergify_cli/tests/queue/ directory had no other content,
so it goes away entirely; the Python yaml dev-dep stays in
place for now (still used elsewhere).

4 tests, same coverage as before:

  • skill_content_is_readable
  • skill_has_valid_frontmatter
  • skill_has_required_sections
  • skill_references_valid_commands

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

Depends-On: #1399

@jd
Copy link
Copy Markdown
Member Author

jd commented May 12, 2026

This pull request is part of a Mergify stack:

# Pull Request Link
1 test(ci): add live smoke test for ci queue-info #1406
2 feat(rust): port ci queue-info to native Rust #1407
3 test(queue): add live smoke test for queue status #1409
4 feat(rust): port queue status to native Rust #1359
5 test: derive native queue commands from the binary, not a hardcoded list #1366
6 test(queue): add live smoke test for queue show #1408
7 feat(rust): port queue show to native Rust #1399
8 test(skill): port the skill-references test to Rust #1414 👈

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 12, 2026

Merge Protections

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

🔴 ⛓️ Depends-On Requirements

Waiting for

This rule is failing.

Requirement based on the presence of Depends-On in the body of the pull request

🔴 👀 Review Requirements

Waiting for

  • #approved-reviews-by>=2
This rule is failing.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🔴 🔎 Reviews

Waiting for

  • #review-requested = 0
This rule is failing.
  • #review-requested = 0
  • #changes-requested-reviews-by = 0
  • #review-threads-unresolved = 0

🟢 🤖 Continuous Integration

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

🟢 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|ui)(?:\(.+\))?:

🟢 📕 PR description

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

@jd jd marked this pull request as ready for review May 12, 2026 13:35
@mergify mergify Bot requested a review from a team May 12, 2026 13:46
Replaces ``mergify_cli/tests/queue/test_skill.py`` with a Rust
integration test in ``crates/mergify-cli/tests/skill_references.rs``.

The test validates two artifacts with no Python in the picture:

- The ``skills/mergify-merge-queue/SKILL.md`` Markdown file
  (frontmatter shape, required sections).
- The Rust binary's ``--list-native-commands`` output (every
  ``mergify queue <cmd>`` reference in the skill must resolve to
  a native command).

Keeping the test in pytest meant carrying Python plumbing for a
language-agnostic concern. The Rust port:

- spawns the binary via ``CARGO_BIN_EXE_mergify`` (the artifact
  ``cargo test`` just built), so the test always exercises the
  current code rather than whatever ``mergify`` happens to be on
  ``PATH``;
- reads the skill file via ``CARGO_MANIFEST_DIR``-relative
  resolution, so it's robust to the cwd;
- adds two dev-deps to ``mergify-cli`` (``regex`` for the
  frontmatter / reference patterns, ``serde_yaml_ng`` for
  frontmatter parsing — already used by ``mergify-ci``).

The ``mergify_cli/tests/queue/`` directory had no other content,
so it goes away entirely; the Python ``yaml`` dev-dep stays in
place for now (still used elsewhere).

4 tests, same coverage as before:

- ``skill_content_is_readable``
- ``skill_has_valid_frontmatter``
- ``skill_has_required_sections``
- ``skill_references_valid_commands``

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Change-Id: I7eb5e3849dcb4219341be78173717ecd137f2d08
@jd jd force-pushed the devs/jd/worktree-rust-port/port-queue-show-native-rust--6c265303 branch from 72c4bf3 to 9d67b7f Compare May 13, 2026 08:25
@jd jd force-pushed the devs/jd/worktree-rust-port/port-skill-refs-test-rust--7eb5e384 branch from 1c824a4 to c051a4c Compare May 13, 2026 08:25
@jd
Copy link
Copy Markdown
Member Author

jd commented May 13, 2026

Revision history

# Type Changes Reason Date
1 initial 1c824a4 2026-05-13 08:25 UTC
2 rebase 1c824a4 → c051a4c (rebase only) 2026-05-13 08:25 UTC

@jd jd temporarily deployed to func-tests-live May 13, 2026 08:25 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 13, 2026 08:25 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 13, 2026 08:25 Failure
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.

1 participant