Target E2E tests with net472 only on Windows by DaveTryon · Pull Request #910 · microsoft/sbom-tool (original) (raw)

While helping with #881, I noticed that the Microsoft.Sbom.Targets.E2E.Tests project was targeting net472 on non-windows platforms, but that none of them were actually running. Tests for Linux, macOS, and macOS-arm64 all produced the error message, with minor variation in the root path (line breaks added to make it simpler to read):

No test is available in <root>/s/test/Microsoft.Sbom.Targets.E2E.Tests/bin/Debug/net472/Microsoft.Sbom.Targets.E2E.Tests.dll.
Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.

The Microsoft.Sbom.Targets.Tests project already restricts net472 targeting to Windows. This PR simply brings the same pattern to the E2E tests. It doesn't actually change what tests are running, but explicitly identifies the effective state of the tests. This change is needed for #881 to proceed successfully.