Skip to content

Better handle tests which require new MSBuild features #11369

@dsplaisted

Description

@dsplaisted

When we add tests which depend on a new feature in MSBuild, we often mark them as CoreMSBuildOnly, as the version of VS we use for CI hasn't been updated yet, so the full Framework versions of tests would fail.

Ideally we would go back and re-enable those tests on full Framework once we do update CI so that it can successfully run those tests. However, it's likely that we rarely do.

To solve this, we can:

  • Create RequiresMSBuildVersionFact and RequiresMSBuildVersionTheory attributes which take an argument specifying the version of VS / MSBuild required (such as 16.5).
    • These tests should always run on core MSBuild
    • On Full Framework, ideally these tests should check the version of MSBuild and only skip running if it's not high enough
    • If we don't have a good way of detecting the version of MSBuild, we could always skip these test on Full Framework, and periodically audit them and convert them to vanilla Facts and Theories once CI can run them
  • Go back and audit existing CoreMSBuildOnly tests, and convert them to vanilla tests or RequiresMSBuildVersion tests if the reason they were core only was because they depended on new MSBuild features at the time they were written.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions