Skip to content

Commit

Permalink
add net9 to test framework (#2909)
Browse files Browse the repository at this point in the history
* add net9 to test framework

* fix codeql workflow

* fix test
  • Loading branch information
TimothyMothra authored Dec 31, 2024
1 parent e34286b commit 404ab40
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-and-test-BASE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
framework: [net452, net462, net472, net480, net481, netcoreapp3.1, net6.0, net7.0, net8.0]
framework: [net452, net462, net472, net480, net481, netcoreapp3.1, net6.0, net7.0, net8.0, net9.0]
include:
- os: ubuntu-latest
args: "--filter TestCategory!=WindowsOnly"
Expand All @@ -40,6 +40,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
- name: Restore
run: dotnet restore ${{ env.SOLUTION }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-and-test-LOGGING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
framework: [net452, net462, net472, net480, net481, netcoreapp3.1, net6.0, net7.0, net8.0]
framework: [net452, net462, net472, net480, net481, netcoreapp3.1, net6.0, net7.0, net8.0, net9.0]

steps:
- uses: actions/checkout@v4
Expand All @@ -37,6 +37,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
- name: Restore
run: dotnet restore ${{ env.SOLUTION }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-and-test-NETCORE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
framework: [net452, net462, net472, net480, net481, netcoreapp3.1, net6.0, net7.0, net8.0]
framework: [net452, net462, net472, net480, net481, netcoreapp3.1, net6.0, net7.0, net8.0, net9.0]
include:
- os: ubuntu-latest
args: "--filter TestCategory!=WindowsOnly"
Expand All @@ -40,6 +40,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
- name: Restore
run: dotnet restore ${{ env.SOLUTION }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-and-test-WEB.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
framework: [net452, net462, net472, net480, net481, netcoreapp3.1, net6.0, net7.0, net8.0]
framework: [net452, net462, net472, net480, net481, netcoreapp3.1, net6.0, net7.0, net8.0, net9.0]

steps:
- uses: actions/checkout@v4
Expand All @@ -37,6 +37,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
- name: Restore
run: dotnet restore ${{ env.SOLUTION }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql-csharp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/redfield-sanity-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
framework: [netcoreapp3.1,net6.0,net7.0,net8.0]
framework: [netcoreapp3.1,net6.0,net7.0,net8.0,net9.0]
include:
- os: ubuntu-latest
args: "--filter TestCategory!=WindowsOnly"
Expand All @@ -40,6 +40,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
- name: Restore
run: dotnet restore ${{ env.SOLUTION }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.x
- name: Restore
run: dotnet restore ${{ matrix.solution }}
Expand Down
2 changes: 1 addition & 1 deletion .props/Test.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
- net7.0 (GA Nov 2022)
-->

<SupportedFrameworks_NetCore>net8.0;net7.0;net6.0;netcoreapp3.1;</SupportedFrameworks_NetCore>
<SupportedFrameworks_NetCore>net9.0;net8.0;net7.0;net6.0;netcoreapp3.1;</SupportedFrameworks_NetCore>
<SupportedFrameworks_NetFx Condition="$(OS) == 'Windows_NT'">net481;net480;net472;net462;</SupportedFrameworks_NetFx>
<LegacyFrameworks_NetFx Condition="$(OS) == 'Windows_NT'">net46;net452;</LegacyFrameworks_NetFx>

Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
<LangVersion>preview</LangVersion>

<IsNetFramework Condition="'$(TargetFramework)' == 'net452' Or '$(TargetFramework)' == 'net46' Or '$(TargetFramework)' == 'net461' Or '$(TargetFramework)' == 'net462' Or '$(TargetFramework)' == 'net472' Or '$(TargetFramework)' == 'net480' Or '$(TargetFramework)' == 'net481' ">True</IsNetFramework>
<IsNetCore Condition="'$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net8.0'">True</IsNetCore>
<IsNetStandard20 Condition="'$(TargetFramework)' == 'net461' Or '$(TargetFramework)' == 'net462' Or '$(TargetFramework)' == 'net472' Or '$(TargetFramework)' == 'net480' Or '$(TargetFramework)' == 'net481' Or '$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net8.0'">True</IsNetStandard20>
<IsNetCore Condition="'$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net8.0' Or '$(TargetFramework)' == 'net9.0'">True</IsNetCore>
<IsNetStandard20 Condition="'$(TargetFramework)' == 'net461' Or '$(TargetFramework)' == 'net462' Or '$(TargetFramework)' == 'net472' Or '$(TargetFramework)' == 'net480' Or '$(TargetFramework)' == 'net481' Or '$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net8.0' Or '$(TargetFramework)' == 'net9.0'">True</IsNetStandard20>

<!-- .NET 6 introduces implicit global usings.
This causes build errors in our multi-target projects.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
</None>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="[9.*-*,10.0)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="[8.*-*,9.0)" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private void RemoveTestEnvVarsAssociatedToModule(AppServicesHeartbeatTelemetryMo
{
foreach (var kvp in appServicesHbeatModule.WebHeartbeatPropertyNameEnvVarMap)
{
Environment.SetEnvironmentVariable(kvp.Value, string.Empty);
Environment.SetEnvironmentVariable(kvp.Value, null);
}
}
}
Expand Down

0 comments on commit 404ab40

Please sign in to comment.