Skip to content

Migrate OpenCvSharp.Analyzers.Tests to xunit v3 - #2020

Merged
shimat merged 1 commit into
mainfrom
fix/analyzers-tests-xunit-v3
Jul 5, 2026
Merged

shimat merged 1 commit into
mainfrom
fix/analyzers-tests-xunit-v3

Conversation

@shimat

@shimat shimat commented Jul 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Referenced in the Renovate Dependency Dashboard (Dependency Dashboard #1894): test/OpenCvSharp.Analyzers.Tests was the only test project still on xunit v2, blocking the deprecated Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit / xunit v2 dependencies from being auto-updated by Renovate.
  • Replaced Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit with the framework-agnostic Microsoft.CodeAnalysis.CSharp.Analyzer.Testing package, and swapped XUnitVerifier for DefaultVerifier in the four analyzer test files.
  • Bumped xunit → xunit.v3 (3.2.2) and xunit.runner.visualstudio → 3.1.5, matching the other test projects (OpenCvSharp.Tests, OpenCvSharp.Tests.Windows).

Test plan

  • dotnet build succeeds
  • dotnet test — all 23 tests pass

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

Summary by CodeRabbit

  • Tests
    • Updated analyzer test infrastructure to use the newer verifier setup across several test suites.
    • Modernized test project dependencies to align with the latest xUnit and analyzer testing packages.
  • Chores
    • Removed obsolete test imports and streamlined test configuration.

Replace the obsolete Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit
package with the framework-agnostic Analyzer.Testing package and
DefaultVerifier, and bump xunit/xunit.runner.visualstudio to v3 to match
the other test projects.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bee76f18-8011-46bf-b297-0c8a82cfff2d

📥 Commits

Reviewing files that changed from the base of the PR and between 0868a40 and 5a38320.

📒 Files selected for processing (5)
  • test/OpenCvSharp.Analyzers.Tests/MatPropertyInLoopConditionAnalyzerTests.cs
  • test/OpenCvSharp.Analyzers.Tests/OpenCvSharp.Analyzers.Tests.csproj
  • test/OpenCvSharp.Analyzers.Tests/RowAtAnalyzerTests.cs
  • test/OpenCvSharp.Analyzers.Tests/RowColInLoopBodyAnalyzerTests.cs
  • test/OpenCvSharp.Analyzers.Tests/RowColNotDisposedAnalyzerTests.cs

📝 Walkthrough

Walkthrough

The test project's package references are updated to replace xunit v2 and the XUnit-specific analyzer testing package with xunit.v3, updated xunit.runner.visualstudio, and the base Microsoft.CodeAnalysis.CSharp.Analyzer.Testing package. Four analyzer test files switch their CSharpAnalyzerTest verifier from XUnitVerifier to DefaultVerifier, removing the corresponding using directive.

Changes

xunit v3 migration

Layer / File(s) Summary
Test project package references
test/OpenCvSharp.Analyzers.Tests/OpenCvSharp.Analyzers.Tests.csproj
Removes xunit v2 and the XUnit-specific analyzer testing package; adds xunit.v3, updated xunit.runner.visualstudio, and the base Microsoft.CodeAnalysis.CSharp.Analyzer.Testing package.
Switch verifier to DefaultVerifier
test/OpenCvSharp.Analyzers.Tests/MatPropertyInLoopConditionAnalyzerTests.cs, test/OpenCvSharp.Analyzers.Tests/RowAtAnalyzerTests.cs, test/OpenCvSharp.Analyzers.Tests/RowColInLoopBodyAnalyzerTests.cs, test/OpenCvSharp.Analyzers.Tests/RowColNotDisposedAnalyzerTests.cs
Removes the Microsoft.CodeAnalysis.Testing.Verifiers using directive and updates CSharpAnalyzerTest construction in each Verify helper to use DefaultVerifier instead of XUnitVerifier.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Sequence Diagram(s)

Not applicable — this change is a test-infrastructure dependency swap without new control flow or multi-component interaction.

Related PRs: None identified.

Suggested labels: tests, dependencies

Suggested reviewers: shimat

🚥 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 accurately summarizes the main change: migrating the OpenCvSharp.Analyzers.Tests project to xUnit v3.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/analyzers-tests-xunit-v3

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.

@shimat shimat self-assigned this Jul 5, 2026
@shimat
shimat merged commit ab00195 into main Jul 5, 2026
14 checks passed
@shimat
shimat deleted the fix/analyzers-tests-xunit-v3 branch July 5, 2026 13:03
@shimat shimat added the enhancement New feature or improvement to OpenCvSharp label Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or improvement to OpenCvSharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant