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/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 new file mode 100644 index 00000000000..7ff94966057 --- /dev/null +++ b/evergreen/compile-sources.sh @@ -0,0 +1,32 @@ +#!/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 + +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." + 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 attempt $ATTEMPT failed. Retrying in $DELAY seconds..." + sleep $DELAY +done + +dotnet build -c Release --no-restore -p:Version="$PACKAGE_VERSION" diff --git a/evergreen/evergreen.yml b/evergreen/evergreen.yml index e5ff5d4794c..0028fe35679 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: @@ -376,7 +343,7 @@ functions: - "FRAMEWORK" script: | ${PREPARE_SHELL} - bash evergreen/run-unit-tests.sh + bash ./evergreen/run-unit-tests.sh run-tests: - command: shell.exec @@ -614,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 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 397d5bb6701..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} @@ -7,5 +7,5 @@ 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" +. ./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" 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 @@ - - - -