Skip to content

Commit 6a4e4d2

Browse files
Copilotstephentoub
andauthored
Skip .NET Framework tests on non-Windows platforms (#1226)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
1 parent 50d6d0b commit 6a4e4d2

5 files changed

Lines changed: 9 additions & 12 deletions

File tree

.github/workflows/ci-build-test.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,6 @@ jobs:
4747
10.0.x
4848
9.0.x
4949
50-
# NetFX testing on non-Windows requires mono
51-
- name: 🔧 Setup Mono
52-
if: runner.os == 'Linux'
53-
run: sudo apt-get install -y mono-devel
54-
55-
- name: 🔧 Setup Mono on macOS
56-
if: runner.os == 'macOS'
57-
run: brew install mono
58-
5950
- name: 🔧 Set up Node.js
6051
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
6152
with:

Directory.Build.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,10 @@
4545
<!-- Don't use x64 when running netfx test procs on Windows ARM -->
4646
<PreferNativeArm64>true</PreferNativeArm64>
4747
</PropertyGroup>
48+
49+
<PropertyGroup>
50+
<!-- Shared target frameworks for test projects and test support projects. net472 is only included on Windows. -->
51+
<DefaultTestTargetFrameworks>net10.0;net9.0;net8.0</DefaultTestTargetFrameworks>
52+
<DefaultTestTargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(DefaultTestTargetFrameworks);net472</DefaultTestTargetFrameworks>
53+
</PropertyGroup>
4854
</Project>

samples/TestServerWithHosting/TestServerWithHosting.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net10.0;net9.0;net8.0;net472</TargetFrameworks>
5+
<TargetFrameworks>$(DefaultTestTargetFrameworks)</TargetFrameworks>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<PublishAot Condition="'$(TargetFramework)' == 'net9.0'">true</PublishAot>

tests/ModelContextProtocol.TestServer/ModelContextProtocol.TestServer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net10.0;net9.0;net8.0;net472</TargetFrameworks>
5+
<TargetFrameworks>$(DefaultTestTargetFrameworks)</TargetFrameworks>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<AssemblyName>TestServer</AssemblyName>

tests/ModelContextProtocol.Tests/ModelContextProtocol.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net10.0;net9.0;net8.0;net472</TargetFrameworks>
5+
<TargetFrameworks>$(DefaultTestTargetFrameworks)</TargetFrameworks>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

0 commit comments

Comments
 (0)