Skip to content

refactor(tests): split mapping-test-cases.yaml by subcommand - #776

Merged
ewanharris merged 1 commit into
mainfrom
feat/mapping-test-split
Oct 8, 2026
Merged

ewanharris merged 1 commit into
mainfrom
feat/mapping-test-split

Conversation

@ewanharris

@ewanharris ewanharris commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Stacks on #775.

mapping-test-cases.yaml covered all four mapping subcommands in one file. Splits it into one file per subcommand — mapping-validate-test-cases.yaml, mapping-test-test-cases.yaml, mapping-init-test-cases.yaml, and mapping-evaluate-test-cases.yaml — so each is independently scannable and test failures are immediately attributable to a subcommand.

No runner changes needed. Commander discovers all YAML files in tests/ via --dir, so the new files are picked up automatically.

Summary by CodeRabbit

  • Tests
    • Expanded CLI coverage for mapping initialization, testing, and validation, including JSON output, filtering, invalid input, unsupported formats, and exit codes.
    • Updated evaluation tests to identify evaluate as the primary command and verify that its deprecated run alias warns while still producing output.

Copilot AI balanced review requested due to automatic review settings October 8, 2026 15:34
@ewanharris
ewanharris requested a review from a team as a code owner October 8, 2026 15:34
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d69c7a38-0e98-4cad-9497-a77248b2e772
📥 Commits

Reviewing files that changed from the base of the PR and between 5802421 and 91ce94e.

📒 Files selected for processing (4)
  • tests/mapping-evaluate-test-cases.yaml
  • tests/mapping-init-test-cases.yaml
  • tests/mapping-test-test-cases.yaml
  • tests/mapping-validate-test-cases.yaml

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.


Walkthrough

The PR updates YAML CLI test cases for mapping evaluation, initialization, testing, and validation. The cases specify expected output and exit codes, including the deprecated run alias and its warning.

Changes

Mapping CLI tests

Layer / File(s) Summary
Evaluate command cases
tests/mapping-evaluate-test-cases.yaml
The evaluation cases are renumbered and organized around evaluate. Existing expectations remain, including the run alias deprecation-warning case.
Initialization command cases
tests/mapping-init-test-cases.yaml
The cases cover standard initialization and --minimal initialization, with checks for exit codes and stdout content.
Test and validate command cases
tests/mapping-test-test-cases.yaml, tests/mapping-validate-test-cases.yaml
Mapping test cases cover successful runs, compile errors, filtering, and no matches. Validation cases cover valid and invalid mappings, JSON output, and unsupported format handling.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Suggested reviewers: aaguiarz

Merge Risk: ⚪ Minimal · up to 91ce9

This is a test-only reorganization with no production behavior change, and no merge-blocking risk was identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: splitting the combined mapping test cases by subcommand. It matches the pull request objectives and the file changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

🟢 Approval recommended

The refactor preserves all existing scenarios and the test runner discovers each new suite automatically.

0 open findings

What changed in this PR

Splits mapping integration tests by subcommand while preserving automatic Commander discovery.

Changes:

  • Separates validate, test, init, and evaluate scenarios.
  • Renumbers test cases within each suite without changing coverage.
File Description
tests/​mapping-validate-test-cases.yaml Contains validation tests.
tests/​mapping-test-test-cases.yaml Contains mapping test-runner tests.
tests/​mapping-init-test-cases.yaml Contains initialization tests.
tests/​mapping-evaluate-test-cases.yaml Retains evaluate and deprecated alias tests.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Base automatically changed from feat/mapping-evaluate-command to main October 8, 2026 16:13
@ewanharris
ewanharris force-pushed the feat/mapping-test-split branch from 760d1bc to 6a1811e Compare October 8, 2026 16:16
mapping-test-cases.yaml covered all four mapping subcommands in one
file. Splits it into one file per subcommand so each is independently
scannable and failures are immediately attributable.

Commander discovers all YAML files in tests/ via --dir, so no runner
changes are needed.
@ewanharris
ewanharris force-pushed the feat/mapping-test-split branch from 6a1811e to 91ce94e Compare October 8, 2026 16:17
@ewanharris
ewanharris added this pull request to the merge queue Oct 8, 2026
Merged via the queue into main with commit ba733d3 Oct 8, 2026
27 checks passed
@ewanharris
ewanharris deleted the feat/mapping-test-split branch October 8, 2026 17:56
@openfga-releaser-bot openfga-releaser-bot Bot mentioned this pull request Oct 15, 2026
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.

3 participants