Repository navigation
test: report unavailable-pipeline graphics tests as Skipped, not Inconclusive - #1294
Conversation
…nclusive The 18 environment guards in ManageGraphicsTests used Assume.That, which yields Inconclusive. Three consumers disagree about what that means: the Test Runner window paints it with a failure icon, run_tests drops it from summary.total while progress.total still counts it (1150 vs 1168), and failures_so_far ignores it. A clean suite therefore reads as 18 failures. Use Assert.Ignore behind an explicit condition instead, matching the existing convention in WriteToConfigTests, StdioBridgeReconnectTests and ManageSceneMultiSceneTests. The helpers are renamed Require* since Assume* named the very API being dropped. Full EditMode suite on 2021.3.45f2 before: 1150 total / 1094 passed / 0 failed / 56 skipped, with 18 inconclusive unaccounted for. After: 1168 / 1094 / 0 / 74, and the two totals reconcile.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughGraphics EditMode tests now skip with ChangesGraphics test gating
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
This PR updates Unity EditMode graphics tests to report environment-dependent cases as Skipped (Ignored) instead of Inconclusive, improving consistency across Unity Test Runner UI and run_tests aggregation.
Changes:
- Replaced
Assume.That(...)environment guards withif (...) Assert.Ignore(...)so unavailable graphics features are treated as skipped. - Renamed helper methods from
Assume*toRequire*to reflect the new behavior and updated call sites accordingly.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…nclusive (upstream CoplayDev#1294) (cherry picked from upstream merge e8fe7fe)
The problem
ManageGraphicsTestsguards 18 environment-dependent tests withAssume.That, which yields Inconclusive. Three consumers disagree about what Inconclusive means:run_testssummarysummary.totalrun_testsprogressprogress.totalfailures_so_farSo a completely clean suite reports
progress.total 1168againstsummary.total 1150, and anyone reading the Test Runner window concludes 18 tests are broken. That is exactly what happened, and it cost real triage time.TestProjects/UnityMCPTestsruns the Built-in pipeline with no render-pipelines-core, somanage_graphicspingreturnshasVolumeSystem/hasURP/hasHDRPall false and all 18 guards trip. This reproduces on a pristinebetacheckout.The fix
Assert.Ignorebehind an explicit condition — NUnit has no condition-taking overload, hence theif. That buckets them asSkipped:Ignored, which every consumer already agrees on, and drops the misleadingExpected: True / But was: Falsetext from the message.This matches the convention already used elsewhere in the suite for exactly this "environment not available" pattern:
WriteToConfigTests.cs:44,StdioBridgeReconnectTests.cs:30,ManageSceneMultiSceneTests.cs:28.The two helpers are renamed
AssumeVolumeSystem→RequireVolumeSystemandAssumeURP→RequireURP, sinceAssume*named the very NUnit API being dropped. That accounts for the 17 otherwise-mechanical call-site lines in the diff.Result
Full EditMode suite on 2021.3.45f2:
progress.totalsummary.totalpassedis unchanged, and the two totals now reconcile.Scope note
This does not change the run's top-level
resultState, which stays"Skipped:Ignored"— roughly 56 legitimately-skipped tests already force that on a pristinebeta. Flagging it because it matters for any future CI gate:"Skipped:Ignored"is not"Passed", so a gate keyed onresultStatewould report false red on a clean suite. That is a separate problem from this PR.Four
Assert.Inconclusivecalls elsewhere (MCPToolParameterTests.cs:200,UIDocumentSerializationTests.cs:105/136/232) are left alone — they currently pass, and changing the failure mode of passing tests would be speculative.Summary by CodeRabbit