Skip to content

Conversation

@dsarno
Copy link
Collaborator

@dsarno dsarno commented Jan 29, 2026

Summary

Updates CodexConfigHelperTests to account for the new --prerelease explicit arguments added to the uvx command for beta server mode support.

Changes

Updated assertion indices in 4 test methods to match the new argument order:

  • --prerelease (index 0)
  • explicit (index 1)
  • --from (index 2)
  • mcpforunityserver>=0.0.0a0 (index 3)
  • mcp-for-unity (index 4)

Previously the tests expected --from at index 0, but with beta server mode support, these arguments are now prepended.

Tests Fixed

  • BuildCodexServerBlock_OnWindows_IncludesSystemRootEnv
  • BuildCodexServerBlock_OnNonWindows_ExcludesEnv
  • UpsertCodexServerBlock_OnWindows_IncludesSystemRootEnv
  • UpsertCodexServerBlock_OnNonWindows_ExcludesEnv

🤖 Generated with Claude Code

Summary by Sourcery

Tests:

  • Adjust CodexConfigHelper uvx argument assertions in four Windows and non-Windows tests to expect the prepended --prerelease explicit flags and updated argument count.

Summary by CodeRabbit

  • Tests
    • Updated test validations to reflect changes in the Codex server command argument structure, now expecting an expanded parameter sequence across build configurations and integration scenarios.

✏️ Tip: You can customize this high-level summary in your review settings.

…x command

The uvx command now includes --prerelease and explicit arguments before --from
due to beta server mode support. Updated test assertions to check for the
correct argument order:

Before: [--from, mcpforunityserver>=0.0.0a0, mcp-for-unity, ...]
After:  [--prerelease, explicit, --from, mcpforunityserver>=0.0.0a0, mcp-for-unity, ...]

Updated tests:
- BuildCodexServerBlock_OnWindows_IncludesSystemRootEnv
- BuildCodexServerBlock_OnNonWindows_ExcludesEnv
- UpsertCodexServerBlock_OnWindows_IncludesSystemRootEnv
- UpsertCodexServerBlock_OnNonWindows_ExcludesEnv

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jan 29, 2026

Reviewer's Guide

Adjusts CodexConfigHelper tests to match the new uvx command argument order that now prepends --prerelease explicit before the existing --from/package arguments.

File-Level Changes

Change Details Files
Update uvx argument assertions in CodexConfigHelper tests for new prerelease-prefixed ordering.
  • Increase the minimum expected args length from 3 to 5 to account for additional prerelease flags.
  • Add extraction of fourth and fifth TOML string arguments from the args array in each affected test.
  • Change assertions to expect --prerelease and explicit at indices 0 and 1, --from at index 2, the PyPI package reference at index 3, and mcp-for-unity at index 4.
  • Update assertion failure messages to describe the full five-argument structure.
TestProjects/UnityMCPTests/Assets/Tests/EditMode/Helpers/CodexConfigHelperTests.cs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Test assertions were updated to expect an expanded five-argument structure for Codex server commands, replacing the previous three-argument validation. The pattern --prerelease, explicit, --from, PyPI package reference, and mcp-for-unity is now verified consistently across multiple test scenarios.

Changes

Cohort / File(s) Summary
CodexConfigHelper Test Updates
TestProjects/UnityMCPTests/Assets/Tests/EditMode/Helpers/CodexConfigHelperTests.cs
Updated test assertions to validate expanded five-element argument structure for Codex server command generation, replacing three-argument validation. Changes applied across Windows/non-Windows build tests and UpsertCodexServerBlock scenarios.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 Five arguments now hop into view,
Where three once danced the old review,
Prerelease, explicit, and PyPI's name,
This rabbit tests with hoppy acclaim! 🎉

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@dsarno dsarno merged commit b555550 into CoplayDev:beta Jan 29, 2026
1 of 2 checks passed
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • These tests are now quite brittle to exact argument ordering and count (e.g., indexing 0–4 with ChildrenCount >= 5); consider asserting the presence and relative order of key arguments in a more flexible way (or using ChildrenCount == 5) to avoid breakage on benign changes to the CLI.
  • The argument validation logic is duplicated across the four test cases; extracting a shared helper to assert the uvx arg structure would reduce repetition and keep future changes to the arg layout in one place.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- These tests are now quite brittle to exact argument ordering and count (e.g., indexing 0–4 with `ChildrenCount >= 5`); consider asserting the presence and relative order of key arguments in a more flexible way (or using `ChildrenCount == 5`) to avoid breakage on benign changes to the CLI.
- The argument validation logic is duplicated across the four test cases; extracting a shared helper to assert the uvx arg structure would reduce repetition and keep future changes to the arg layout in one place.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@dsarno dsarno deleted the fix/codex-config-test-args branch January 30, 2026 17:54
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