Skip to content

CSHARP-4991: Add .NET 8 to Smoke Tests #1280

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

Merged
merged 1 commit into from
Mar 5, 2024
Merged
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
2 changes: 2 additions & 0 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ Task("SmokeTestsNetCoreApp21").IsDependentOn("SmokeTests");
Task("SmokeTestsNetCoreApp31").IsDependentOn("SmokeTests");
Task("SmokeTestsNet50").IsDependentOn("SmokeTests");
Task("SmokeTestsNet60").IsDependentOn("SmokeTests");
Task("SmokeTestsNet80").IsDependentOn("SmokeTests");

Task("TestsPackaging")
.IsDependentOn("TestsPackagingProjectReference")
Expand Down Expand Up @@ -658,6 +659,7 @@ Setup<BuildConfig>(
string s when s.EndsWith("net472") => "net472",
string s when s.EndsWith("net50") => "net5.0",
string s when s.EndsWith("net60") => "net6.0",
string s when s.EndsWith("net80") => "net8.0",
_ => null
};

Expand Down
2 changes: 2 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ if($FoundDotNetCliVersion -ne $DotNetVersion) {
& bash $ScriptPath --install-dir "$InstallPath" --channel 2.1 --no-path
& bash $ScriptPath --install-dir "$InstallPath" --channel 3.1 --no-path
& bash $ScriptPath --install-dir "$InstallPath" --channel 5.0 --no-path
& bash $ScriptPath --install-dir "$InstallPath" --channel 8.0 --no-path
& bash $ScriptPath --version "$DotNetVersion" --install-dir "$InstallPath" --channel "$DotNetChannel" --no-path

Remove-PathVariable "$InstallPath"
Expand All @@ -113,6 +114,7 @@ if($FoundDotNetCliVersion -ne $DotNetVersion) {
& $ScriptPath -Channel 2.1 -InstallDir $InstallPath;
& $ScriptPath -Channel 3.1 -InstallDir $InstallPath;
& $ScriptPath -Channel 5.0 -InstallDir $InstallPath;
& $ScriptPath -Channel 8.0 -InstallDir $InstallPath;
& $ScriptPath -Channel $DotNetChannel -Version $DotNetVersion -InstallDir $InstallPath;

Remove-PathVariable "$InstallPath"
Expand Down
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ if [ "$DOTNET_VERSION" != "$DOTNET_INSTALLED_VERSION" ]; then
bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --channel 2.1 --architecture x64 --install-dir .dotnet --no-path
bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --channel 3.1 --architecture x64 --install-dir .dotnet --no-path
bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --channel 5.0 --architecture x64 --install-dir .dotnet --no-path
bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --channel 8.0 --architecture x64 --install-dir .dotnet --no-path
bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version $DOTNET_VERSION --install-dir .dotnet --no-path
export PATH="$SCRIPT_DIR/.dotnet":$PATH
export DOTNET_ROOT="$SCRIPT_DIR/.dotnet"
Expand Down
10 changes: 10 additions & 0 deletions evergreen/evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,13 @@ tasks:
vars:
FRAMEWORK: net60

- name: test-smoke-tests-net80
commands:
- func: bootstrap-mongo-orchestration
- func: run-smoke-tests
vars:
FRAMEWORK: net80

- name: performance-tests-net60-server-v6.0
commands:
- func: bootstrap-mongo-orchestration
Expand Down Expand Up @@ -2306,6 +2313,7 @@ buildvariants:
- name: test-smoke-tests-netcoreapp31
- name: test-smoke-tests-net50
- name: test-smoke-tests-net60
- name: test-smoke-tests-net80

- matrix_name: "smoke-tests-linux"
matrix_spec: { os: "ubuntu-2004", ssl: "nossl", version: ["5.0", "6.0", "7.0", "latest"], topology: ["replicaset"] }
Expand All @@ -2316,6 +2324,7 @@ buildvariants:
- name: test-smoke-tests-netcoreapp31
- name: test-smoke-tests-net50
- name: test-smoke-tests-net60
- name: test-smoke-tests-net80

- matrix_name: "smoke-tests-macOS"
matrix_spec: { os: "macos-1100", ssl: "nossl", version: ["5.0", "6.0", "7.0", "latest"], topology: ["replicaset"] }
Expand All @@ -2326,6 +2335,7 @@ buildvariants:
- name: test-smoke-tests-netcoreapp31
- name: test-smoke-tests-net50
- name: test-smoke-tests-net60
- name: test-smoke-tests-net80

# Package release variants
- matrix_name: build-packages
Expand Down
4 changes: 2 additions & 2 deletions evergreen/install-dotnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ if [[ $OS =~ [Ww]indows.* ]]; then
echo "Downloading Windows .NET SDK installer into $DOTNET_SDK_PATH folder..."
curl -Lfo "$DOTNET_SDK_PATH"/dotnet-install.ps1 https://dot.net/v1/dotnet-install.ps1
echo "Installing .NET LTS SDK..."
powershell.exe "$DOTNET_SDK_PATH"/dotnet-install.ps1 -Channel 6.0 -InstallDir "$DOTNET_SDK_PATH" -NoPath
powershell.exe "$DOTNET_SDK_PATH"/dotnet-install.ps1 -Channel 8.0 -InstallDir "$DOTNET_SDK_PATH" -NoPath
else
echo "Downloading .NET SDK installer into $DOTNET_SDK_PATH folder..."
curl -Lfo "$DOTNET_SDK_PATH"/dotnet-install.sh https://dot.net/v1/dotnet-install.sh
echo "Installing .NET LTS SDK..."
bash "$DOTNET_SDK_PATH"/dotnet-install.sh --channel 6.0 --install-dir "$DOTNET_SDK_PATH" --no-path
bash "$DOTNET_SDK_PATH"/dotnet-install.sh --channel 8.0 --install-dir "$DOTNET_SDK_PATH" --no-path
fi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1;net472;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1;net472;net5.0;net6.0;net8.0</TargetFrameworks>
<LangVersion>9</LangVersion>
<CodeAnalysisRuleSet>..\..\..\MongoDBTest.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
Expand Down Expand Up @@ -54,6 +54,13 @@
<PackageReference Include="Microsoft.Extensions.Logging.TraceSource" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
Copy link
Member

Choose a reason for hiding this comment

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

Should it be 8.0.*, so we get up-to-date with patches?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure, we've fixed the versions for other frameworks as well. So maybe we should evaluate this in a different ticket?

<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.TraceSource" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<None Update="xunit.runner.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand Down