Skip .NET Framework tests on non-Windows platforms#1226
Conversation
- Configure TargetFrameworks to conditionally include net472 only on Windows - Remove mono setup steps from CI workflow Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
tests/ModelContextProtocol.Tests/ModelContextProtocol.Tests.csproj
Outdated
Show resolved
Hide resolved
Define DefaultTestTargetFrameworks in root Directory.Build.props with conditional net472 on Windows, then reference it from the test projects. Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
|
I think this change creates problems for people developing in non-Windows platforms, since they are no longer able to test the netstandard2.0 build of the product locally. This also applies to CCA which AFAIK uses a linux dev environment. If there are any reliability issues related to the mono runtime specifically, my suggestion would be to just skip those impacted tests. |
You're running with mono locally?
My experience is that it's not just one test but impacts many. I don't believe it's worth our time in narrowing it down to whatever subset is affected. You disagree and want do so? |
Yes, I pretty much have to when I develop on the mac.
That hasn't been my experience, the tests that have been flaky were specific and we were disabling those where appropriate.
I can, but maybe as an intermediate compromise we could just turn off that target for CI only? I don't see why we'd want to throw away the ability to build and run the net4x test projects locally on non-Windows environments. That should benefit CCA as well? |
|
If your goal it to validate the netstandard2.0 build, it'd be better to do so running against .NET Core rather than against mono. Running with the legacy mono is not a real-world scenario we care about and not something to waste time or resources validating locally or in CI. |
|
How could we set this up to work in practice? Use an older .NET Core TFM in tests that's only used in non-Windows platforms? |
|
Works for me. Although I should say this wouldn't prevent accidental breaks on the build of net4xx targets in the test projects unless we also come up with a way to address that (dummy netstandard2.0 targets for test projects perhaps?) |
.github/workflows/ci-build-test.ymlDirectory.Build.propsDefaultTestTargetFrameworksproperty in rootDirectory.Build.props$(DefaultTestTargetFrameworks)💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.