Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add net9 to test framework #2909

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like there was a runtime change.
NET8 and prior expected this call to delete the Environment Variable.
One of the tests was asserting that the Environment Variable was empty.

Starting in NET9, this was setting the Environment Variable to string.Empty, causing the same test to fail.

}
}
}
Expand Down
Loading