From 8832bbca74123334e774ecc66c52c8992eff4ada Mon Sep 17 00:00:00 2001 From: Oleksandr Poliakov Date: Mon, 17 Nov 2025 10:51:00 -0800 Subject: [PATCH 1/6] CSHARP-5784: Execute dotnet restore with retries on Evergreen --- build.cake | 152 ------------------ evergreen/compile-sources.sh | 26 +++ evergreen/evergreen.yml | 90 ++++++----- evergreen/run-unit-tests.sh | 3 +- evergreen/set-virtualenv.sh | 35 ---- .../Configuration/ConnectionStringTests.cs | 6 + .../MongoUrlBuilderTests.cs | 8 + tests/MongoDB.Driver.Tests/MongoUrlTests.cs | 6 + tools/packages.config | 4 - 9 files changed, 101 insertions(+), 229 deletions(-) create mode 100644 evergreen/compile-sources.sh delete mode 100644 evergreen/set-virtualenv.sh delete mode 100644 tools/packages.config diff --git a/build.cake b/build.cake index 031fed96be8..0a0dc25ea6c 100644 --- a/build.cake +++ b/build.cake @@ -25,9 +25,6 @@ var artifactsPackagesDirectory = artifactsDirectory.Combine("packages"); var srcDirectory = solutionDirectory.Combine("src"); var testsDirectory = solutionDirectory.Combine("tests"); var outputDirectory = solutionDirectory.Combine("build"); -var toolsDirectory = solutionDirectory.Combine("tools"); -var toolsHugoDirectory = toolsDirectory.Combine("Hugo"); -var mongoDbDriverPackageName = "MongoDB.Driver"; var solutionFile = solutionDirectory.CombineWithFilePath("CSharpDriver.sln"); var solutionFullPath = solutionFile.FullPath; @@ -35,72 +32,7 @@ var solutionFullPath = solutionFile.FullPath; Task("Default") .IsDependentOn("Test"); -Task("Release") - .IsDependentOn("Build") - .IsDependentOn("Package"); - -Task("Restore") - .Does(() => - { - // disable parallel restore to work around apparent bugs in restore - var restoreSettings = new DotNetRestoreSettings - { - DisableParallel = true - }; - DotNetRestore(solutionFullPath, restoreSettings); - }); - -Task("Build") - .IsDependentOn("Restore") - .Does((buildConfig) => - { - var settings = new DotNetBuildSettings - { - NoRestore = true, - Configuration = configuration, - EnvironmentVariables = new Dictionary - { - { "Version", gitVersion.LegacySemVer }, - { "SourceRevisionId", gitVersion.Sha } - } - }; - - DotNetBuild(solutionFullPath, settings); - }); - -Task("BuildArtifacts") - .IsDependentOn("Build") - .Does(() => - { - foreach (var targetFramework in new[] { "net472", "netstandard2.0", "netstandard2.1" }) - { - var toDirectory = artifactsBinDirectory.Combine(targetFramework); - CleanDirectory(toDirectory); - - var projects = new[] { "MongoDB.Bson", "MongoDB.Driver" }; - foreach (var project in projects) - { - var fromDirectory = srcDirectory.Combine(project).Combine("bin").Combine(configuration).Combine(targetFramework); - - var fileNames = new List(); - foreach (var extension in new[] { "dll", "pdb", "xml" }) - { - var fileName = $"{project}.{extension}"; - fileNames.Add(fileName); - } - - foreach (var fileName in fileNames) - { - var fromFile = fromDirectory.CombineWithFilePath(fileName); - var toFile = toDirectory.CombineWithFilePath(fileName); - CopyFile(fromFile, toFile); - } - } - } - }); - Task("Test") - .IsDependentOn("Build") .DoesForEach( items: GetFiles("./**/*.Tests.csproj").Where(name => !name.ToString().Contains("Atlas")), action: (BuildConfig buildConfig, Path testProject) => @@ -121,68 +53,58 @@ Task("Test") .DeferOnError(); Task("TestAwsAuthentication") - .IsDependentOn("Build") .DoesForEach( items: GetFiles("./**/MongoDB.Driver.Tests.csproj"), action: (BuildConfig buildConfig, Path testProject) => RunTests(buildConfig, testProject, filter: "Category=\"AwsMechanism\"")); Task("TestPlainAuthentication") - .IsDependentOn("Build") .DoesForEach( items: GetFiles("./**/MongoDB.Driver.Tests.csproj"), action: (BuildConfig buildConfig, Path testProject) => RunTests(buildConfig, testProject, filter: "Category=\"PlainMechanism\"")); Task("TestAtlasConnectivity") - .IsDependentOn("Build") .DoesForEach( items: GetFiles("./**/AtlasConnectivity.Tests.csproj"), action: (BuildConfig buildConfig, Path testProject) => RunTests(buildConfig, testProject)); Task("TestAtlasSearch") - .IsDependentOn("Build") .DoesForEach( items: GetFiles("./**/MongoDB.Driver.Tests.csproj"), action: (BuildConfig buildConfig, Path testProject) => RunTests(buildConfig, testProject, filter: "Category=\"AtlasSearch\"")); Task("TestAtlasSearchIndexHelpers") - .IsDependentOn("Build") .DoesForEach( items: GetFiles("./**/MongoDB.Driver.Tests.csproj"), action: (BuildConfig buildConfig, Path testProject) => RunTests(buildConfig, testProject, filter: "Category=\"AtlasSearchIndexHelpers\"")); Task("TestOcsp") - .IsDependentOn("Build") .DoesForEach( items: GetFiles("./**/MongoDB.Driver.Tests.csproj"), action: (BuildConfig buildConfig, Path testProject) => RunTests(buildConfig, testProject, filter: "Category=\"OCSP\"")); Task("TestGssapi") - .IsDependentOn("Build") .DoesForEach( items: GetFiles("./**/MongoDB.Driver.Tests.csproj"), action: (BuildConfig buildConfig, Path testProject) => RunTests(buildConfig, testProject, filter: "Category=\"GssapiMechanism\"")); Task("TestMongoDbOidc") - .IsDependentOn("Build") .DoesForEach( items: GetFiles("./**/MongoDB.Driver.Tests.csproj"), action: (BuildConfig buildConfig, Path testProject) => RunTests(buildConfig, testProject, filter: "Category=\"MongoDbOidc\"")); Task("TestLibMongoCrypt") - .IsDependentOn("Build") .DoesForEach( items: GetFiles("./**/MongoDB.Driver.Encryption.Tests.csproj"), action: (BuildConfig buildConfig, Path testProject) => RunTests(buildConfig, testProject)); Task("TestLoadBalanced") - .IsDependentOn("Build") .DoesForEach( items: GetFiles("./**/*.Tests.csproj"), action: (BuildConfig buildConfig, Path testProject) => @@ -217,91 +139,17 @@ Task("TestCsfleWithGcpKms") RunTests(buildConfig, testProject, filter: "Category=\"CsfleGCPKMS\"")); Task("TestX509") - .IsDependentOn("Build") .DoesForEach( items: GetFiles("./**/MongoDB.Driver.Tests.csproj"), action: (BuildConfig buildConfig, Path testProject) => RunTests(buildConfig, testProject, filter: "Category=\"X509\"")); Task("TestSocks5Proxy") - .IsDependentOn("Build") .DoesForEach( items: GetFiles("./**/*.Tests.csproj"), action: (BuildConfig buildConfig, Path testProject) => RunTests(buildConfig, testProject, filter: "Category=\"Socks5Proxy\"")); -Task("Package") - .IsDependentOn("PackageNugetPackages"); - -Task("PackageNugetPackages") - .IsDependentOn("Build") - .Does((buildConfig) => - { - EnsureDirectoryExists(artifactsPackagesDirectory); - CleanDirectory(artifactsPackagesDirectory); - - var projects = new[] - { - "MongoDB.Bson", - "MongoDB.Driver", - "MongoDB.Driver.Encryption" - }; - - foreach (var project in projects) - { - var projectPath = $"{srcDirectory}\\{project}\\{project}.csproj"; - var settings = new DotNetPackSettings - { - Configuration = configuration, - OutputDirectory = artifactsPackagesDirectory, - NoBuild = true, // SetContinuousIntegrationBuild is enabled for nupkg on the Build step - IncludeSymbols = true, - MSBuildSettings = new DotNetMSBuildSettings() - // configure deterministic build for better compatibility with debug symbols (used in Package/Build tasks). Affects: *.snupkg - .SetContinuousIntegrationBuild(continuousIntegrationBuild: true) - .WithProperty("PackageVersion", buildConfig.PackageVersion) - }; - DotNetPack(projectPath, settings); - } - }); - -Task("PushToNuGet") - .Does(() => - { - var nugetApiKey = EnvironmentVariable("NUGETAPIKEY"); - if (nugetApiKey == null) - { - throw new Exception("NUGETAPIKEY environment variable missing"); - } - - var packageFiles = new List(); - - var projects = new[] - { - "MongoDB.Bson", - "MongoDB.Driver" - }; - - foreach (var project in projects) - { - var packageFileName = $"{project}.{gitVersion.LegacySemVer}.nupkg"; - var packageFile = artifactsPackagesDirectory.CombineWithFilePath(packageFileName); - packageFiles.Add(packageFile); - } - - NuGetPush(packageFiles, new NuGetPushSettings - { - ApiKey = nugetApiKey, - Source = "https://api.nuget.org/v3/index.json" - }); - }); - -Task("DumpGitVersion") - .Does(() => - { - Information(gitVersion.Dump()); - }); - Task("SmokeTests") .DoesForEach( GetFiles("./**/SmokeTests/**/*.SmokeTests*.csproj"), diff --git a/evergreen/compile-sources.sh b/evergreen/compile-sources.sh new file mode 100644 index 00000000000..cde4b07ce53 --- /dev/null +++ b/evergreen/compile-sources.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -o errexit # Exit the script with error if any of the commands fail + +RESTORE_MAX_RETRIES=5 +RESTORE_RETRY_DELAY_SECONDS_MULTIPLIER=10 + +for (( ATTEMPT=1; ATTEMPT<=RESTORE_MAX_RETRIES; ATTEMPT++ )) +do + echo "Attempt $ATTEMPT of $RESTORE_MAX_RETRIES to run dotnet restore..." + dotnet restore || exit_status=$? + if [[ "$exit_status" -eq 0 ]]; then + echo "dotnet restore succeeded." + break + fi + + if [[ $ATTEMPT -eq $RESTORE_MAX_RETRIES ]]; then + echo "Failed to restore packages after $RESTORE_MAX_RETRIES retries." + exit 1 + fi + + DELAY=$((ATTEMPT * RESTORE_RETRY_DELAY_SECONDS_MULTIPLIER)) + echo "dotnet restore failed. Retrying in $DELAY seconds..." + sleep $DELAY +done + +dotnet build -c Release --no-restore diff --git a/evergreen/evergreen.yml b/evergreen/evergreen.yml index e5ff5d4794c..8d35e0b0902 100644 --- a/evergreen/evergreen.yml +++ b/evergreen/evergreen.yml @@ -104,13 +104,14 @@ functions: - command: shell.exec type: system params: + working_dir: mongo-csharp-driver include_expansions_in_env: - "OS" - "DOTNET_SDK_VERSION" - "FRAMEWORK" script: | ${PREPARE_SHELL} - bash ${PROJECT_DIRECTORY}/evergreen/install-dotnet.sh + bash evergreen/install-dotnet.sh prepare-resources: - command: shell.exec @@ -196,40 +197,6 @@ functions: content_type: ${content_type|text/plain} display_name: "orchestration.log" - upload-working-dir: - - command: archive.targz_pack - params: - target: "working-dir.tar.gz" - source_dir: ${PROJECT_DIRECTORY}/ - include: - - "./**" - - command: s3.put - params: - aws_key: ${aws_key} - aws_secret: ${aws_secret} - local_file: working-dir.tar.gz - remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/artifacts/${task_id}-${execution}-working-dir.tar.gz - bucket: mciuploads - permissions: public-read - content_type: ${content_type|application/x-gzip} - display_name: "working-dir.tar.gz" - - command: archive.targz_pack - params: - target: "drivers-dir.tar.gz" - source_dir: ${DRIVERS_TOOLS} - include: - - "./**" - - command: s3.put - params: - aws_key: ${aws_key} - aws_secret: ${aws_secret} - local_file: drivers-dir.tar.gz - remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/artifacts/${task_id}-${execution}-drivers-dir.tar.gz - bucket: mciuploads - permissions: public-read - content_type: ${content_type|application/x-gzip} - display_name: "drivers-dir.tar.gz" - upload-test-results: - command: attach.xunit_results params: @@ -256,6 +223,16 @@ functions: params: file: mo-expansion.yml + compile-sources: + - command: shell.exec + type: system + params: + working_dir: "mongo-csharp-driver" + shell: "bash" + script: | + ${PREPARE_SHELL} + bash ./evergreen/compile-sources.sh + download-and-promote-augmented-sbom-to-s3-bucket: - command: ec2.assume_role params: @@ -376,7 +353,7 @@ functions: - "FRAMEWORK" script: | ${PREPARE_SHELL} - bash evergreen/run-unit-tests.sh + bash ./evergreen/run-unit-tests.sh run-tests: - command: shell.exec @@ -1151,6 +1128,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net472 + - func: compile-sources - func: run-unit-tests - name: unit-tests-netstandard21 @@ -1158,6 +1136,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: netstandard2.1 + - func: compile-sources - func: run-unit-tests - name: unit-tests-net60 @@ -1165,6 +1144,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-unit-tests - name: test-net472 @@ -1174,6 +1154,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net472 + - func: compile-sources - func: run-tests - name: test-netstandard21 @@ -1183,6 +1164,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: netstandard2.1 + - func: compile-sources - func: run-tests - name: test-net60 @@ -1192,6 +1174,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-tests - name: test-csfle-with-mongocryptd-net472 @@ -1201,6 +1184,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net472 + - func: compile-sources - func: run-csfle-with-mongocryptd-tests - name: test-csfle-with-mongocryptd-netstandard21 @@ -1210,6 +1194,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: netstandard2.1 + - func: compile-sources - func: run-csfle-with-mongocryptd-tests - name: test-csfle-with-mongocryptd-net60 @@ -1219,6 +1204,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-csfle-with-mongocryptd-tests - name: test-csfle-with-mocked-kms-tls-net472 @@ -1229,6 +1215,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net472 + - func: compile-sources - func: run-csfle-with-mocked-kms-tests - name: test-csfle-with-mocked-kms-tls-netstandard21 @@ -1239,6 +1226,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: netstandard2.1 + - func: compile-sources - func: run-csfle-with-mocked-kms-tests - name: test-csfle-with-mocked-kms-tls-net60 @@ -1249,6 +1237,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-csfle-with-mocked-kms-tests - name: test-load-balancer-netstandard21 @@ -1260,6 +1249,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: netstandard2.1 + - func: compile-sources - func: run-load-balancer-tests - func: stop-load-balancer @@ -1272,6 +1262,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-load-balancer-tests - func: stop-load-balancer @@ -1281,6 +1272,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-atlas-connectivity-tests - name: test-gssapi-net472 @@ -1288,6 +1280,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net472 + - func: compile-sources - func: run-gssapi-auth-tests - name: test-gssapi-netstandard21 @@ -1295,6 +1288,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: netstandard2.1 + - func: compile-sources - func: run-gssapi-auth-tests - name: test-gssapi-net60 @@ -1302,6 +1296,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-gssapi-auth-tests - name: test-socks5-proxy-net472 @@ -1311,6 +1306,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net472 + - func: compile-sources - func: run-socks5-proxy-tests - name: test-socks5-proxy-netstandard21 @@ -1320,6 +1316,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: netstandard21 + - func: compile-sources - func: run-socks5-proxy-tests - name: test-socks5-proxy-net60 @@ -1329,6 +1326,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net60 + - func: compile-sources - func: run-socks5-proxy-tests - name: plain-auth-tests @@ -1336,6 +1334,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-plain-auth-tests - name: aws-auth-tests @@ -1349,6 +1348,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources # This step also creates test related users, so don't avoid this step in order to run other tests - func: run-aws-auth-test-with-regular-aws-credentials - func: run-aws-auth-test-with-assume-role-credentials @@ -1368,6 +1368,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net472 + - func: compile-sources - func: run-tests vars: REQUIRE_API_VERSION: true @@ -1381,6 +1382,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: netstandard2.1 + - func: compile-sources - func: run-tests vars: REQUIRE_API_VERSION: true @@ -1394,6 +1396,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-tests vars: REQUIRE_API_VERSION: true @@ -1404,6 +1407,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-atlas-search-test - name: atlas-search-index-helpers-test @@ -1411,6 +1415,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-atlas-search-index-helpers-test - name: test-oidc-auth @@ -1418,6 +1423,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-mongodb-oidc-tests - name: test-oidc-azure @@ -1491,6 +1497,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1509,6 +1516,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1527,6 +1535,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1545,6 +1554,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1559,6 +1569,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1577,6 +1588,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1591,6 +1603,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1609,6 +1622,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1627,6 +1641,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1645,6 +1660,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1663,6 +1679,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1681,6 +1698,7 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 + - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" diff --git a/evergreen/run-unit-tests.sh b/evergreen/run-unit-tests.sh index 397d5bb6701..869d7d17fa5 100644 --- a/evergreen/run-unit-tests.sh +++ b/evergreen/run-unit-tests.sh @@ -7,5 +7,4 @@ if [ "$FRAMEWORK" = "netstandard2.1" ]; then FRAMEWORK="netcoreapp3.1" fi -dotnet build -dotnet test --no-build --filter "Category!=Integration" -f "$FRAMEWORK" --results-directory ./build/test-results --logger "junit;verbosity=detailed;LogFileName=TEST-{assembly}.xml;FailureBodyFormat=Verbose" --logger "console;verbosity=detailed" +dotnet test -c Release --no-build --filter "Category!=Integration" -f "$FRAMEWORK" --results-directory ./build/test-results --logger "junit;verbosity=detailed;LogFileName=TEST-{assembly}.xml;FailureBodyFormat=Verbose" --logger "console;verbosity=detailed" diff --git a/evergreen/set-virtualenv.sh b/evergreen/set-virtualenv.sh deleted file mode 100644 index 950854a74ce..00000000000 --- a/evergreen/set-virtualenv.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash - -# Find the version of python on the system. -# If the directory "venv" exists, start the virtual environment. -# Otherwise, install a new virtual environment. -# -# Environment variables used as input: -# OS The current operating system -# -# Environment variables produced as output: -# PYTHON The venv python path - -echo "Initialize PYTHON" - -if [ -e "/cygdrive/c/python/Python36/python" ]; then - export SYSTEM_PYTHON="/cygdrive/c/python/Python36/python" -elif [ -e "/opt/mongodbtoolchain/v3/bin/python3" ]; then - export SYSTEM_PYTHON="/opt/mongodbtoolchain/v3/bin/python3" -elif python3 --version >/dev/null 2>&1; then - export SYSTEM_PYTHON=python3 -else - export SYSTEM_PYTHON=python -fi - -if [ ! -e venv ]; then - $SYSTEM_PYTHON -m venv ./venv -fi - -if [ "Windows_NT" = "$OS" ]; then - export PYTHON="$(pwd)/venv/Scripts/python" -else - export PYTHON="$(pwd)/venv/bin/python" -fi - -echo "PYTHON has been initialized" diff --git a/tests/MongoDB.Driver.Tests/Core/Configuration/ConnectionStringTests.cs b/tests/MongoDB.Driver.Tests/Core/Configuration/ConnectionStringTests.cs index a0793d0a299..8ea1d64ac31 100644 --- a/tests/MongoDB.Driver.Tests/Core/Configuration/ConnectionStringTests.cs +++ b/tests/MongoDB.Driver.Tests/Core/Configuration/ConnectionStringTests.cs @@ -441,7 +441,9 @@ public void When_everything_is_specified() "socketTimeout=40ms;" + "ssl=false;" + "sslVerifyCertificate=true;" + +#if DEBUG // TODO: CSOT: Make it public when CSOT will be ready for GA "timeout=42ms;" + +#endif "waitQueueMultiple=10;" + "waitQueueSize=30;" + "waitQueueTimeout=60ms;" + @@ -490,7 +492,9 @@ public void When_everything_is_specified() subject.Ssl.Should().BeFalse(); subject.SslVerifyCertificate.Should().Be(true); #pragma warning restore 618 +#if DEBUG // TODO: CSOT: Make it public when CSOT will be ready for GA subject.Timeout.Should().Be(TimeSpan.FromMilliseconds(42)); +#endif subject.Tls.Should().BeFalse(); subject.TlsInsecure.Should().Be(false); subject.Username.Should().Be("user"); @@ -1063,6 +1067,7 @@ public void When_sslVerifyCertificate_is_specified(string connectionString, bool #pragma warning restore 618 } +#if DEBUG // TODO: CSOT: Make it public when CSOT will be ready for GA [Theory] [InlineData("mongodb://localhost?timeoutMS=0", -1)] [InlineData("mongodb://localhost?timeout=0", -1)] @@ -1078,6 +1083,7 @@ public void When_timeout_is_specified(string connectionString, int milliseconds) subject.Timeout.Should().Be(TimeSpan.FromMilliseconds(milliseconds)); } +#endif [Theory] [InlineData("mongodb://localhost?tls=true", true)] diff --git a/tests/MongoDB.Driver.Tests/MongoUrlBuilderTests.cs b/tests/MongoDB.Driver.Tests/MongoUrlBuilderTests.cs index f45282623dc..fa65f19215e 100644 --- a/tests/MongoDB.Driver.Tests/MongoUrlBuilderTests.cs +++ b/tests/MongoDB.Driver.Tests/MongoUrlBuilderTests.cs @@ -94,7 +94,9 @@ public void TestAll() ServerMonitoringMode = ServerMonitoringMode.Poll, ServerSelectionTimeout = TimeSpan.FromSeconds(10), SocketTimeout = TimeSpan.FromSeconds(7), +#if DEBUG // TODO: CSOT: Make it public when CSOT will be ready for GA Timeout = TimeSpan.FromSeconds(13), +#endif Username = "username", #pragma warning disable 618 UseSsl = true, @@ -141,7 +143,9 @@ public void TestAll() "serverMonitoringMode=Poll", "serverSelectionTimeout=10s", "socketTimeout=7s", +#if DEBUG // TODO: CSOT: Make it public when CSOT will be ready for GA "timeout=13s", +#endif "waitQueueSize=123", "waitQueueTimeout=8s", "retryReads=false", @@ -187,7 +191,9 @@ public void TestAll() Assert.Equal(ServerMonitoringMode.Poll, builder.ServerMonitoringMode); Assert.Equal(TimeSpan.FromSeconds(10), builder.ServerSelectionTimeout); Assert.Equal(TimeSpan.FromSeconds(7), builder.SocketTimeout); +#if DEBUG // TODO: CSOT: Make it public when CSOT will be ready for GA Assert.Equal(TimeSpan.FromSeconds(13), builder.Timeout); +#endif Assert.Equal("username", builder.Username); #pragma warning disable 618 Assert.Equal(true, builder.UseSsl); @@ -1140,6 +1146,7 @@ public void TestSocketTimeout_Range() builder.SocketTimeout = TimeSpan.FromSeconds(1); } +#if DEBUG // TODO: CSOT: Make it public when CSOT will be ready for GA [Theory] [InlineData(null, "mongodb://localhost", new[] { "" })] [InlineData(-1, "mongodb://localhost/?timeout{0}", new[] { "=0", "MS=0" })] @@ -1161,6 +1168,7 @@ public void TestTimeout(int? ms, string formatString, string[] values) Assert.Equal(canonicalConnectionString, builder.ToString()); } } +#endif [Fact] public void TestSrvServiceName() diff --git a/tests/MongoDB.Driver.Tests/MongoUrlTests.cs b/tests/MongoDB.Driver.Tests/MongoUrlTests.cs index e63873964ce..96a23b8240b 100644 --- a/tests/MongoDB.Driver.Tests/MongoUrlTests.cs +++ b/tests/MongoDB.Driver.Tests/MongoUrlTests.cs @@ -186,7 +186,9 @@ public void TestAll() ServerMonitoringMode = ServerMonitoringMode.Poll, ServerSelectionTimeout = TimeSpan.FromSeconds(10), SocketTimeout = TimeSpan.FromSeconds(7), +#if DEBUG // TODO: CSOT: Make it public when CSOT will be ready for GA Timeout = TimeSpan.FromSeconds(13), +#endif Username = "username", UseTls = true, W = 2, @@ -226,7 +228,9 @@ public void TestAll() "serverMonitoringMode=Poll", "serverSelectionTimeout=10s", "socketTimeout=7s", +#if DEBUG // TODO: CSOT: Make it public when CSOT will be ready for GA "timeout=13s", +#endif "waitQueueSize=123", "waitQueueTimeout=8s", "retryReads=false", @@ -270,7 +274,9 @@ public void TestAll() Assert.Equal(ServerMonitoringMode.Poll, url.ServerMonitoringMode); Assert.Equal(TimeSpan.FromSeconds(10), url.ServerSelectionTimeout); Assert.Equal(TimeSpan.FromSeconds(7), url.SocketTimeout); +#if DEBUG // TODO: CSOT: Make it public when CSOT will be ready for GA Assert.Equal(TimeSpan.FromSeconds(13), url.Timeout); +#endif Assert.Equal(true, url.TlsDisableCertificateRevocationCheck); Assert.Equal("username", url.Username); #pragma warning disable 618 diff --git a/tools/packages.config b/tools/packages.config deleted file mode 100644 index 19c3c9401cb..00000000000 --- a/tools/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - From 46d2184f7fe2e6a6988cc870e68d3bba2f055ba4 Mon Sep 17 00:00:00 2001 From: Oleksandr Poliakov Date: Mon, 17 Nov 2025 13:33:59 -0800 Subject: [PATCH 2/6] pr --- evergreen/compile-sources.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/evergreen/compile-sources.sh b/evergreen/compile-sources.sh index cde4b07ce53..32178a845f1 100644 --- a/evergreen/compile-sources.sh +++ b/evergreen/compile-sources.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env bash set -o errexit # Exit the script with error if any of the commands fail RESTORE_MAX_RETRIES=5 @@ -7,6 +7,7 @@ RESTORE_RETRY_DELAY_SECONDS_MULTIPLIER=10 for (( ATTEMPT=1; ATTEMPT<=RESTORE_MAX_RETRIES; ATTEMPT++ )) do echo "Attempt $ATTEMPT of $RESTORE_MAX_RETRIES to run dotnet restore..." + exit_status=0 dotnet restore || exit_status=$? if [[ "$exit_status" -eq 0 ]]; then echo "dotnet restore succeeded." From f585a450cc8724d0d98ca8086ba458e1d5de0efa Mon Sep 17 00:00:00 2001 From: Oleksandr Poliakov Date: Mon, 17 Nov 2025 13:44:41 -0800 Subject: [PATCH 3/6] Pr --- evergreen/build-packages.sh | 3 ++- evergreen/compile-sources.sh | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/evergreen/build-packages.sh b/evergreen/build-packages.sh index aa140bd5bf9..ea6d63462d6 100644 --- a/evergreen/build-packages.sh +++ b/evergreen/build-packages.sh @@ -12,4 +12,5 @@ fi echo Creating nuget package... dotnet clean ./CSharpDriver.sln -dotnet pack ./CSharpDriver.sln -o ./artifacts/nuget -c Release -p:Version="$PACKAGE_VERSION" --include-symbols -p:SymbolPackageFormat=snupkg -p:ContinuousIntegrationBuild=true \ No newline at end of file +. ./evergreen/compile-sources.sh +dotnet pack ./CSharpDriver.sln --no-build -o ./artifacts/nuget -c Release -p:Version="$PACKAGE_VERSION" --include-symbols -p:SymbolPackageFormat=snupkg -p:ContinuousIntegrationBuild=true diff --git a/evergreen/compile-sources.sh b/evergreen/compile-sources.sh index 32178a845f1..3eedf4edec4 100644 --- a/evergreen/compile-sources.sh +++ b/evergreen/compile-sources.sh @@ -1,6 +1,11 @@ #!/usr/bin/env bash set -o errexit # Exit the script with error if any of the commands fail +if [ -z "$PACKAGE_VERSION" ]; then + PACKAGE_VERSION=$(bash ./evergreen/get-version.sh) + echo Calculated PACKAGE_VERSION value: "$PACKAGE_VERSION" +fi + RESTORE_MAX_RETRIES=5 RESTORE_RETRY_DELAY_SECONDS_MULTIPLIER=10 @@ -24,4 +29,4 @@ do sleep $DELAY done -dotnet build -c Release --no-restore +dotnet build -c Release --no-restore -p:Version="$PACKAGE_VERSION" From 65d0d38e1c854a192ba2798e2835f86ca81f3a92 Mon Sep 17 00:00:00 2001 From: Oleksandr Poliakov Date: Wed, 19 Nov 2025 09:15:35 -0800 Subject: [PATCH 4/6] pr --- evergreen/evergreen.yml | 52 +------------------ evergreen/run-atlas-connectivity-tests.sh | 1 + .../run-atlas-search-index-helpers-test.sh | 3 +- evergreen/run-atlas-search-test.sh | 3 +- evergreen/run-csfle-azure-tests.sh | 1 + evergreen/run-csfle-gcp-tests.sh | 1 + evergreen/run-gssapi-auth-tests.sh | 2 + evergreen/run-load-balancer-tests.sh | 1 + evergreen/run-mongodb-aws-test.sh | 1 + evergreen/run-mongodb-oidc-tests.sh | 1 + evergreen/run-plain-auth-tests.sh | 1 + evergreen/run-tests.sh | 1 + evergreen/run-unit-tests.sh | 1 + 13 files changed, 16 insertions(+), 53 deletions(-) diff --git a/evergreen/evergreen.yml b/evergreen/evergreen.yml index 8d35e0b0902..0028fe35679 100644 --- a/evergreen/evergreen.yml +++ b/evergreen/evergreen.yml @@ -223,16 +223,6 @@ functions: params: file: mo-expansion.yml - compile-sources: - - command: shell.exec - type: system - params: - working_dir: "mongo-csharp-driver" - shell: "bash" - script: | - ${PREPARE_SHELL} - bash ./evergreen/compile-sources.sh - download-and-promote-augmented-sbom-to-s3-bucket: - command: ec2.assume_role params: @@ -591,6 +581,7 @@ functions: echo "This platform does not support the ECS auth test, skipping..." exit 0 fi + . ./evergreen/compile-sources.sh echo "Project Directory: $PROJECT_DIRECTORY" # SRC_DIRECTORY is workaround since EG_TOOLS expects "src" folder as a root SRC_DIRECTORY=$(dirname $PROJECT_DIRECTORY)/src @@ -1128,7 +1119,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net472 - - func: compile-sources - func: run-unit-tests - name: unit-tests-netstandard21 @@ -1136,7 +1126,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: netstandard2.1 - - func: compile-sources - func: run-unit-tests - name: unit-tests-net60 @@ -1144,7 +1133,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-unit-tests - name: test-net472 @@ -1154,7 +1142,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net472 - - func: compile-sources - func: run-tests - name: test-netstandard21 @@ -1164,7 +1151,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: netstandard2.1 - - func: compile-sources - func: run-tests - name: test-net60 @@ -1174,7 +1160,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-tests - name: test-csfle-with-mongocryptd-net472 @@ -1184,7 +1169,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net472 - - func: compile-sources - func: run-csfle-with-mongocryptd-tests - name: test-csfle-with-mongocryptd-netstandard21 @@ -1194,7 +1178,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: netstandard2.1 - - func: compile-sources - func: run-csfle-with-mongocryptd-tests - name: test-csfle-with-mongocryptd-net60 @@ -1204,7 +1187,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-csfle-with-mongocryptd-tests - name: test-csfle-with-mocked-kms-tls-net472 @@ -1215,7 +1197,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net472 - - func: compile-sources - func: run-csfle-with-mocked-kms-tests - name: test-csfle-with-mocked-kms-tls-netstandard21 @@ -1226,7 +1207,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: netstandard2.1 - - func: compile-sources - func: run-csfle-with-mocked-kms-tests - name: test-csfle-with-mocked-kms-tls-net60 @@ -1237,7 +1217,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-csfle-with-mocked-kms-tests - name: test-load-balancer-netstandard21 @@ -1249,7 +1228,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: netstandard2.1 - - func: compile-sources - func: run-load-balancer-tests - func: stop-load-balancer @@ -1262,7 +1240,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-load-balancer-tests - func: stop-load-balancer @@ -1272,7 +1249,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-atlas-connectivity-tests - name: test-gssapi-net472 @@ -1280,7 +1256,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net472 - - func: compile-sources - func: run-gssapi-auth-tests - name: test-gssapi-netstandard21 @@ -1288,7 +1263,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: netstandard2.1 - - func: compile-sources - func: run-gssapi-auth-tests - name: test-gssapi-net60 @@ -1296,7 +1270,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-gssapi-auth-tests - name: test-socks5-proxy-net472 @@ -1306,7 +1279,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net472 - - func: compile-sources - func: run-socks5-proxy-tests - name: test-socks5-proxy-netstandard21 @@ -1316,7 +1288,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: netstandard21 - - func: compile-sources - func: run-socks5-proxy-tests - name: test-socks5-proxy-net60 @@ -1326,7 +1297,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net60 - - func: compile-sources - func: run-socks5-proxy-tests - name: plain-auth-tests @@ -1334,7 +1304,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-plain-auth-tests - name: aws-auth-tests @@ -1348,7 +1317,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources # This step also creates test related users, so don't avoid this step in order to run other tests - func: run-aws-auth-test-with-regular-aws-credentials - func: run-aws-auth-test-with-assume-role-credentials @@ -1368,7 +1336,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net472 - - func: compile-sources - func: run-tests vars: REQUIRE_API_VERSION: true @@ -1382,7 +1349,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: netstandard2.1 - - func: compile-sources - func: run-tests vars: REQUIRE_API_VERSION: true @@ -1396,7 +1362,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-tests vars: REQUIRE_API_VERSION: true @@ -1407,7 +1372,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-atlas-search-test - name: atlas-search-index-helpers-test @@ -1415,7 +1379,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-atlas-search-index-helpers-test - name: test-oidc-auth @@ -1423,7 +1386,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-mongodb-oidc-tests - name: test-oidc-azure @@ -1497,7 +1459,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1516,7 +1477,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1535,7 +1495,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1554,7 +1513,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1569,7 +1527,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1588,7 +1545,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1603,7 +1559,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1622,7 +1577,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1641,7 +1595,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1660,7 +1613,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1679,7 +1631,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" @@ -1698,7 +1649,6 @@ tasks: - func: configure-framework vars: FRAMEWORK: net6.0 - - func: compile-sources - func: run-ocsp-test vars: OCSP_ALGORITHM: "rsa" diff --git a/evergreen/run-atlas-connectivity-tests.sh b/evergreen/run-atlas-connectivity-tests.sh index 3ddcfc06643..72e20940b6d 100755 --- a/evergreen/run-atlas-connectivity-tests.sh +++ b/evergreen/run-atlas-connectivity-tests.sh @@ -8,4 +8,5 @@ set -o errexit # Exit the script with error if any of the commands fail # Provision the correct connection string and set up SSL if needed for var in TMP TEMP NUGET_PACKAGES NUGET_HTTP_CACHE_PATH APPDATA; do setx $var z:\\data\\tmp; export $var=z:\\data\\tmp; done +. ./evergreen/compile-sources.sh powershell.exe .\\build.ps1 --target TestAtlasConnectivity diff --git a/evergreen/run-atlas-search-index-helpers-test.sh b/evergreen/run-atlas-search-index-helpers-test.sh index 24bb944bcc8..d90d1234852 100644 --- a/evergreen/run-atlas-search-index-helpers-test.sh +++ b/evergreen/run-atlas-search-index-helpers-test.sh @@ -13,4 +13,5 @@ echo "Running Atlas Search Index Helpers driver tests" export ATLAS_SEARCH_INDEX_HELPERS_TESTS_ENABLED=true -./build.sh --target=TestAtlasSearchIndexHelpers \ No newline at end of file +. ./evergreen/compile-sources.sh +./build.sh --target=TestAtlasSearchIndexHelpers diff --git a/evergreen/run-atlas-search-test.sh b/evergreen/run-atlas-search-test.sh index 41bd7822ec3..3e029cf1c71 100644 --- a/evergreen/run-atlas-search-test.sh +++ b/evergreen/run-atlas-search-test.sh @@ -13,4 +13,5 @@ echo "Running Atlas Search driver tests" export ATLAS_SEARCH_TESTS_ENABLED=true -powershell.exe .\\build.ps1 --target=TestAtlasSearch \ No newline at end of file +. ./evergreen/compile-sources.sh +powershell.exe .\\build.ps1 --target=TestAtlasSearch diff --git a/evergreen/run-csfle-azure-tests.sh b/evergreen/run-csfle-azure-tests.sh index c2a0e343fd0..5ed9360dfd7 100644 --- a/evergreen/run-csfle-azure-tests.sh +++ b/evergreen/run-csfle-azure-tests.sh @@ -24,4 +24,5 @@ export CSFLE_AZURE_KMS_TESTS_ENABLED=true export FRAMEWORK=net6.0 . ./evergreen/install-dotnet.sh +. ./evergreen/compile-sources.sh . ./build.sh --target=TestCsfleWithAzureKms diff --git a/evergreen/run-csfle-gcp-tests.sh b/evergreen/run-csfle-gcp-tests.sh index ee3803ee555..b7cbfdda62e 100644 --- a/evergreen/run-csfle-gcp-tests.sh +++ b/evergreen/run-csfle-gcp-tests.sh @@ -17,4 +17,5 @@ export CSFLE_GCP_KMS_TESTS_ENABLED=true export FRAMEWORK=net6.0 . ./evergreen/install-dotnet.sh +. ./evergreen/compile-sources.sh . ./build.sh --target=TestCsfleWithGcpKms diff --git a/evergreen/run-gssapi-auth-tests.sh b/evergreen/run-gssapi-auth-tests.sh index e58389021c8..ccbc016e7f2 100755 --- a/evergreen/run-gssapi-auth-tests.sh +++ b/evergreen/run-gssapi-auth-tests.sh @@ -29,6 +29,7 @@ if [ "Windows_NT" = "$OS" ]; then export $var=z:\\data\\tmp done + . ./evergreen/compile-sources.sh powershell.exe .\\build.ps1 --target TestGssapi else echo "Setting krb5 config file" @@ -45,5 +46,6 @@ else export $var=/data/tmp; done + . ./evergreen/compile-sources.sh ./build.sh --target=TestGssapi fi; diff --git a/evergreen/run-load-balancer-tests.sh b/evergreen/run-load-balancer-tests.sh index 521faaa639d..71dd6cb3502 100644 --- a/evergreen/run-load-balancer-tests.sh +++ b/evergreen/run-load-balancer-tests.sh @@ -34,4 +34,5 @@ export MONGODB_URI_WITH_MULTIPLE_MONGOSES=${MULTI_MONGOS_LB_URI} # show test output set -x +. ./evergreen/compile-sources.sh ./build.sh --target TestLoadBalanced diff --git a/evergreen/run-mongodb-aws-test.sh b/evergreen/run-mongodb-aws-test.sh index c1c9beb32df..78fbc525ada 100755 --- a/evergreen/run-mongodb-aws-test.sh +++ b/evergreen/run-mongodb-aws-test.sh @@ -41,6 +41,7 @@ export AWS_TESTS_ENABLED=true # show test output set -x +. ./evergreen/compile-sources.sh if [[ "$OS" =~ Windows|windows ]]; then powershell.exe .\\build.ps1 --target=TestAwsAuthentication else diff --git a/evergreen/run-mongodb-oidc-tests.sh b/evergreen/run-mongodb-oidc-tests.sh index a51efceb59c..1a455810ab4 100644 --- a/evergreen/run-mongodb-oidc-tests.sh +++ b/evergreen/run-mongodb-oidc-tests.sh @@ -48,6 +48,7 @@ fi export OIDC_ENV=$OIDC_ENV export MONGODB_URI=$MONGODB_URI +. ./evergreen/compile-sources.sh if [ "Windows_NT" = "$OS" ]; then powershell.exe .\\build.ps1 --target "TestMongoDbOidc" else diff --git a/evergreen/run-plain-auth-tests.sh b/evergreen/run-plain-auth-tests.sh index 31d7e615002..2a94927268d 100755 --- a/evergreen/run-plain-auth-tests.sh +++ b/evergreen/run-plain-auth-tests.sh @@ -19,6 +19,7 @@ fi export MONGODB_URI="${MONGODB_URI}" export PLAIN_AUTH_TESTS_ENABLED=true +. ./evergreen/compile-sources.sh if [[ "$OS" =~ Windows|windows ]]; then powershell.exe \ '.\build.ps1 --target TestPlainAuthentication' diff --git a/evergreen/run-tests.sh b/evergreen/run-tests.sh index 9386cb44161..7ee6391a66f 100755 --- a/evergreen/run-tests.sh +++ b/evergreen/run-tests.sh @@ -161,6 +161,7 @@ EOL fi fi +. ./evergreen/compile-sources.sh if [[ "$OS" =~ Windows|windows ]]; then powershell.exe .\\build.ps1 --target=$TARGET else diff --git a/evergreen/run-unit-tests.sh b/evergreen/run-unit-tests.sh index 869d7d17fa5..d07228456b5 100644 --- a/evergreen/run-unit-tests.sh +++ b/evergreen/run-unit-tests.sh @@ -7,4 +7,5 @@ if [ "$FRAMEWORK" = "netstandard2.1" ]; then FRAMEWORK="netcoreapp3.1" fi +. ./evergreen/compile-sources.sh dotnet test -c Release --no-build --filter "Category!=Integration" -f "$FRAMEWORK" --results-directory ./build/test-results --logger "junit;verbosity=detailed;LogFileName=TEST-{assembly}.xml;FailureBodyFormat=Verbose" --logger "console;verbosity=detailed" From ff06ccf2f6b2da0f03b26e578a81054ec93351c7 Mon Sep 17 00:00:00 2001 From: Oleksandr Poliakov Date: Wed, 19 Nov 2025 12:08:19 -0800 Subject: [PATCH 5/6] PR --- evergreen/compile-sources.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evergreen/compile-sources.sh b/evergreen/compile-sources.sh index 3eedf4edec4..7ff94966057 100644 --- a/evergreen/compile-sources.sh +++ b/evergreen/compile-sources.sh @@ -25,7 +25,7 @@ do fi DELAY=$((ATTEMPT * RESTORE_RETRY_DELAY_SECONDS_MULTIPLIER)) - echo "dotnet restore failed. Retrying in $DELAY seconds..." + echo "dotnet restore attempt $ATTEMPT failed. Retrying in $DELAY seconds..." sleep $DELAY done From 9b06e78cced64c12fb264fe67b6856372a412d3a Mon Sep 17 00:00:00 2001 From: Oleksandr Poliakov Date: Wed, 19 Nov 2025 12:32:07 -0800 Subject: [PATCH 6/6] pr --- evergreen/run-unit-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evergreen/run-unit-tests.sh b/evergreen/run-unit-tests.sh index d07228456b5..c927a3abde9 100644 --- a/evergreen/run-unit-tests.sh +++ b/evergreen/run-unit-tests.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env bash set -o errexit # Exit the script with error if any of the commands fail FRAMEWORK=${FRAMEWORK:-net6.0}