Skip to content

test(setup): look up UpdateDependencyStatus as static too - #1385

Merged
Scriptwonder merged 1 commit into
CoplayDev:betafrom
Scriptwonder:fix/characterization-static-lookup
Sep 5, 2026
Merged

Scriptwonder merged 1 commit into
CoplayDev:betafrom
Scriptwonder:fix/characterization-static-lookup

Conversation

@Scriptwonder

@Scriptwonder Scriptwonder commented Sep 5, 2026 •

Copy link
Copy Markdown
Collaborator

Description

beta is red on WindowsCharacterizationTests.MCPSetupWindow_ModifiesClassListForStatus_ValidInvalidPattern and has been since 9d93c42 (#1383).

Should have UpdateDependencyStatus method
Expected: not null
But was:  null

#1383 made MCPSetupWindow.UpdateDependencyStatus internal static so the new GitDetectionTests could drive it directly. The characterization test still looks it up with BindingFlags.NonPublic | BindingFlags.Instance, which no longer matches a static method, so GetMethod returns null and the fixture dies on its Assert.IsNotNull guard rather than on the behaviour it exists to describe.

Changes Made

Adds BindingFlags.Static alongside Instance, so the lookup works whichever way the method is declared. The test is a characterization test — it records that the window drives "valid"/"invalid" class lists on the indicators, which is still exactly what the method does, so the assertion it makes is unchanged and correct.

Why it was not caught

#1383 came from a fork, where the Unity test legs report Skipped, and the pre-merge EditMode run was filtered to GitDetectionTests. Nothing ran the characterization fixture.

This is the second floor-only miss this cycle. Widening compile-check.yml past defaultVersion is worth doing on its own, but only a real test run catches this class — worth considering whether the maintainer-side pre-merge check should always run the unfiltered suite.

Compatibility / Package Source

  • Unity version(s) tested: 2021.3.45f2 (the package floor, and what TestProjects/UnityMCPTests is pinned to)
  • Package source used: file:
  • Test-only change; no package code touched.

Testing

  • Unity EditMode tests — full suite on 2021.3.45f2: 1243 total, 1163 passed, 0 failed, 80 skipped. WindowsCharacterizationTests on its own: 31/31.
  • Python tests — not applicable, no Server/ change
  • PlayMode tests — not applicable

Before this commit the same full run was 1 failed.

Documentation Updates

  • No tools or resources changed.

Summary by CodeRabbit

  • Tests
    • Updated coverage for dependency status updates to support both static and instance method implementations.
    • Improved test reliability after changes to the underlying method declaration.

CoplayDev#1383 made MCPSetupWindow.UpdateDependencyStatus internal static so the new
GitDetectionTests could drive it directly. The characterization test still
looked it up with BindingFlags.NonPublic | Instance, which no longer matches,
so GetMethod returned null and the fixture failed on the Assert.IsNotNull
guard rather than on the behaviour it exists to describe. beta has been red on
it since 9d93c42.

Adding Static alongside Instance keeps the lookup working whichever way the
method is declared. The test is a characterization test - it records that the
window drives "valid"/"invalid" class lists, which is still exactly what the
method does.

Not caught before merging because CoplayDev#1383 came from a fork, where the Unity test
legs report Skipped, and the pre-merge run was filtered to GitDetectionTests.

Measured on 2021.3.45f2: full EditMode 1243 total, 1163 passed, 0 failed,
80 skipped; WindowsCharacterizationTests 31/31.
Copilot AI lite review requested due to automatic review settings September 5, 2026 21:15
@coderabbitai

coderabbitai Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: bc80caad-f248-4eb6-9356-dcde29f572df

📥 Commits

Reviewing files that changed from the base of the PR and between 9d93c42 and bbc0caa.

📒 Files selected for processing (1)
  • TestProjects/UnityMCPTests/Assets/Tests/EditMode/Windows/Characterization/Windows_Characterization.cs

📝 Walkthrough

Walkthrough

The characterization test now includes BindingFlags.Static when it reflects on UpdateDependencyStatus. The lookup supports both static and instance method declarations.

Changes

Reflection Test Update

Layer / File(s) Summary
UpdateDependencyStatus reflection lookup
TestProjects/UnityMCPTests/Assets/Tests/EditMode/Windows/Characterization/Windows_Characterization.cs
The test combines Static, NonPublic, and Instance binding flags to resolve UpdateDependencyStatus.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 change is a narrow, correct test-only fix that restores reflection lookup compatibility with the current static method signature.

Pull request overview

Fixes a Unity EditMode characterization test that broke after MCPSetupWindow.UpdateDependencyStatus was changed to internal static, by updating the reflection lookup to match static methods as well as instance ones. This keeps the characterization test focused on the intended behavior (CSS class-list changes) rather than failing on a null MethodInfo.

Changes:

  • Update GetMethod BindingFlags to include BindingFlags.Static alongside BindingFlags.Instance.
  • Add an explanatory comment describing why both flags are included and what failure it prevents.
File summaries
File Description
TestProjects/UnityMCPTests/Assets/Tests/EditMode/Windows/Characterization/Windows_Characterization.cs Adjusts reflection BindingFlags so the characterization test can find UpdateDependencyStatus after it became static.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Scriptwonder
Scriptwonder merged commit 2fcc179 into CoplayDev:beta Sep 5, 2026
3 of 4 checks passed
@Scriptwonder
Scriptwonder deleted the fix/characterization-static-lookup branch September 5, 2026 21:16
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.

2 participants