Skip to content

Skip .NET Framework tests on non-Windows platforms#1226

Merged
stephentoub merged 3 commits intomainfrom
copilot/configure-tests-for-dotnet-framework
Jan 30, 2026
Merged

Skip .NET Framework tests on non-Windows platforms#1226
stephentoub merged 3 commits intomainfrom
copilot/configure-tests-for-dotnet-framework

Conversation

Copy link
Contributor

Copilot AI commented Jan 30, 2026

  • Analyze repository structure and identify projects targeting net472
  • Understand current CI workflow (mono installation for Linux/macOS)
  • Remove mono setup steps from .github/workflows/ci-build-test.yml
  • Centralize target framework settings in Directory.Build.props
    • Define DefaultTestTargetFrameworks property in root Directory.Build.props
    • Update test projects to use $(DefaultTestTargetFrameworks)
  • Verify build succeeds on Linux without mono
  • Verify tests run only for net10.0, net9.0, net8.0 on Linux (no net472)

💡 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.

- 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>
Copilot AI changed the title [WIP] Update test configuration to avoid running .NET Framework tests on non-Windows Skip .NET Framework tests on non-Windows platforms Jan 30, 2026
Copilot AI requested a review from stephentoub January 30, 2026 22:17
@stephentoub stephentoub marked this pull request as ready for review January 30, 2026 22:25
@stephentoub stephentoub requested a review from ericstj January 30, 2026 22:25
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>
@stephentoub stephentoub enabled auto-merge (squash) January 30, 2026 22:45
@stephentoub stephentoub merged commit 6a4e4d2 into main Jan 30, 2026
10 checks passed
@stephentoub stephentoub deleted the copilot/configure-tests-for-dotnet-framework branch January 30, 2026 22:56
@eiriktsarpalis
Copy link
Member

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.

@stephentoub
Copy link
Contributor

since they are no longer able to test the netstandard2.0 build of the product locally

You're running with mono locally?

my suggestion would be to just skip those impacted tests.

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?

@eiriktsarpalis
Copy link
Member

eiriktsarpalis commented Feb 2, 2026

since they are no longer able to test the netstandard2.0 build of the product locally

You're running with mono locally?

Yes, I pretty much have to when I develop on the mac.

my suggestion would be to just skip those impacted tests.

My experience is that it's not just one test but impacts many.

That hasn't been my experience, the tests that have been flaky were specific and we were disabling those where appropriate.

You disagree and want do so?

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?

@stephentoub
Copy link
Contributor

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.

@eiriktsarpalis
Copy link
Member

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?

@eiriktsarpalis
Copy link
Member

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?)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants