Skip to content

[Enhancement]: Tests — migrate the xUnit v2 suite to v3, which Xunit.StaFact majors now require #2028

Description

@laurentiu021

Problem

The test suite is on xUnit v2 (xunit 2.9.3). Xunit.StaFact has moved to xUnit v3, so its major line is now unreachable: dependabot PR #2025 (1.2.69 → 4.0.23) failed the Build tests step with hundreds of

error CS0433: The type 'FactAttribute' exists in both
  'xunit.core, Version=2.9.3.0' and 'xunit.v3.core, Version=4.0.0.0'

because both packages get referenced and every [Fact] and [Collection] becomes ambiguous. #2027 adds a dependabot ignore rule for StaFact majors so the same unbuildable PR stops reappearing weekly. That stops the noise; it does not remove the constraint.

SysManager.Tests is the only project referencing StaFact; versions live in Directory.Packages.props under central package management.

Why it is worth doing eventually

StaFact supplies the STA-thread fact attributes the WPF-touching tests need, so being stuck on 1.x means being stuck on whatever xUnit v2 supports. Not urgent — 1.2.69 works and the suite is large and healthy — but the gap only widens, and a forced migration later (a security advisory, or a .NET bump v2 does not follow) is worse than a chosen one.

Scope, so it is not underestimated

Not a package swap. xUnit v3 changes the runner model (each test project becomes an executable), the assertion package layout, and some attribute semantics:

  • SysManager.Tests, SysManager.IntegrationTests and SysManager.UITests all reference xUnit
  • CI runs the suites through dotnet test; the v3 runner is invoked differently
  • xunit.runner.json and the xunit.runner.visualstudio reference change shape
  • collection and fixture attributes are exactly what broke in deps(tests): Bump Xunit.StaFact from 1.2.69 to 4.0.23 #2025, and the suite uses them heavily

Worth doing as its own PR with nothing else mixed in, and worth confirming the suite count is unchanged before and after — the failure mode of a runner migration is tests that silently stop being discovered, not tests that fail.

Affected area

SysManager.Tests, SysManager.IntegrationTests, SysManager.UITests, Directory.Packages.props, CI.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions