Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mongodb/mongo-csharp-driver
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.4.0
Choose a base ref
...
head repository: mongodb/mongo-csharp-driver
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 14 commits
  • 152 files changed
  • 6 contributors

Commits on May 7, 2025

  1. CSHARP-5583: Update README.md (#1681)

    BorisDog authored May 7, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    919fceb View commit details

Commits on May 8, 2025

  1. DEVPROD-17449: Replace perf.send with new direct end point for perfor…

    …mance data submission (#1689)
    MAhmadShah authored May 8, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    6b3835c View commit details

Commits on May 9, 2025

  1. CSHARP-4918: Release notes automation (#1680)

    sanych-sun authored May 9, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    79d97ed View commit details

Commits on May 16, 2025

  1. CSHARP-5591: Configure MongoDB.Driver.Encryption.Tests to run on net4…

    …72 target (#1692)
    sanych-sun authored May 16, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    1713173 View commit details

Commits on May 22, 2025

  1. CSHARP-3435: FilterDefinition Inject method should use root serializer

    rstam committed May 22, 2025
    Copy the full SHA
    fcbc397 View commit details

Commits on May 23, 2025

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    ef4e942 View commit details

Commits on May 24, 2025

  1. CSHARP-5539: Update Atlas Search tests for rankFusion (#1693)

    adelinowona authored May 24, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3410015 View commit details

Commits on May 26, 2025

  1. CSHARP-5596: Remove unused *OpcodeOperation classes (#1698)

    sanych-sun authored May 26, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    75200dd View commit details

Commits on May 27, 2025

  1. CSHARP-5598: Fix CoreServerSessionPool.IsAboutToExpire test (#1699)

    sanych-sun authored May 27, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    dde1ef9 View commit details

Commits on May 29, 2025

  1. CSHARP-3662: MongoClientSettings.SocketTimeout does not work for valu…

    …es under 500ms on Windows for sync code (#1690)
    sanych-sun authored May 29, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    b2f1180 View commit details
  2. CSHARP-4918: Release notes automation (#1701)

    sanych-sun authored May 29, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3ab6460 View commit details

Commits on May 30, 2025

  1. CSHARP-5585: Remove reliance on Evergreen instance profile credentials (

    sanych-sun authored May 30, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    4ecb179 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    66f3552 View commit details

Commits on Jun 3, 2025

  1. CSHARP4040: Fix bug when using field with same element name as discri…

    …minator (#1684)
    papafe authored Jun 3, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2d3e62f View commit details
Showing with 1,126 additions and 1,570 deletions.
  1. +31 −0 .github/workflows/pr.yml
  2. +10 −2 README.md
  3. +1 −7 build.cake
  4. +2 −4 build.ps1
  5. +2 −3 build.sh
  6. +132 −3 evergreen/evergreen.yml
  7. +20 −2 evergreen/install-dotnet.sh
  8. +4 −3 evergreen/release-notes.py
  9. +11 −0 evergreen/run-unit-tests.sh
  10. +16 −1 src/MongoDB.Bson/Serialization/BsonClassMap.cs
  11. +4 −3 src/MongoDB.Bson/Serialization/Conventions/StandardDiscriminatorConvention.cs
  12. +2 −2 src/MongoDB.Driver/Core/Compression/SnappyCompressor.cs
  13. +5 −3 src/MongoDB.Driver/Core/Connections/BinaryConnection.cs
  14. +10 −2 src/MongoDB.Driver/Core/Connections/TcpStreamFactory.cs
  15. +127 −55 src/MongoDB.Driver/Core/Misc/StreamExtensionMethods.cs
  16. +72 −0 src/MongoDB.Driver/Core/Misc/TaskExtensions.cs
  17. +0 −121 src/MongoDB.Driver/Core/Operations/DeleteOpcodeOperation.cs
  18. +0 −144 src/MongoDB.Driver/Core/Operations/DeleteOpcodeOperationEmulator.cs
  19. +0 −161 src/MongoDB.Driver/Core/Operations/InsertOpcodeOperation.cs
  20. +0 −203 src/MongoDB.Driver/Core/Operations/InsertOpcodeOperationEmulator.cs
  21. +0 −133 src/MongoDB.Driver/Core/Operations/UpdateOpcodeOperation.cs
  22. +0 −168 src/MongoDB.Driver/Core/Operations/UpdateOpcodeOperationEmulator.cs
  23. +14 −3 ...ion/Translators/ExpressionToFilterTranslators/MethodTranslators/InjectMethodToFilterTranslator.cs
  24. +0 −4 tests/AstrolabeWorkloadExecutor/AstrolabeWorkloadExecutor.csproj
  25. +0 −4 tests/AtlasConnectivity.Tests/AtlasConnectivity.Tests.csproj
  26. +1 −0 tests/AtlasConnectivity.Tests/ConnectivityTests.cs
  27. +1 −0 tests/BuildProps/Tests.Build.props
  28. +1 −4 tests/MongoDB.Bson.TestHelpers/MongoDB.Bson.TestHelpers.csproj
  29. +2 −6 tests/MongoDB.Bson.Tests/MongoDB.Bson.Tests.csproj
  30. +1 −1 tests/MongoDB.Bson.Tests/Serialization/Conventions/StandardDiscriminatorConventionTests.cs
  31. +3 −7 tests/MongoDB.Driver.Encryption.Tests/MongoDB.Driver.Encryption.Tests.csproj
  32. +4 −4 tests/MongoDB.Driver.Encryption.Tests/xunit.runner.json
  33. +1 −0 tests/MongoDB.Driver.Examples/Aws/AwsAuthenticationExamples.cs
  34. +1 −0 tests/MongoDB.Driver.Examples/CausalConsistencyExamples.cs
  35. +1 −0 tests/MongoDB.Driver.Examples/ChangeStreamExamples.cs
  36. +1 −0 tests/MongoDB.Driver.Examples/ClientEncryptionExamples.cs
  37. +1 −0 tests/MongoDB.Driver.Examples/ClientSideEncryption2Examples.cs
  38. +16 −15 tests/MongoDB.Driver.Examples/DocumentationExamples.cs
  39. +1 −0 tests/MongoDB.Driver.Examples/ExplicitEncryptionExamples.cs
  40. +0 −4 tests/MongoDB.Driver.Examples/MongoDB.Driver.Examples.csproj
  41. +2 −0 tests/MongoDB.Driver.Examples/PrimerTestFixture.cs
  42. +1 −0 tests/MongoDB.Driver.Examples/StableApiExamples.cs
  43. +1 −0 tests/MongoDB.Driver.Examples/TransactionExamplesForDocs/WithTransactionExample1.cs
  44. +1 −1 tests/MongoDB.Driver.TestHelpers/IntegrationTest.cs
  45. +1 −1 tests/MongoDB.Driver.TestHelpers/MongoDB.Driver.TestHelpers.csproj
  46. +1 −1 tests/MongoDB.Driver.Tests/AggregateFluentFacetTests.cs
  47. +1 −0 tests/MongoDB.Driver.Tests/AggregateFluentGraphLookupWithAirportsCollectionTests.cs
  48. +1 −0 tests/MongoDB.Driver.Tests/AggregateFluentGraphLookupWithEmployeeCollectionTests.cs
  49. +1 −0 tests/MongoDB.Driver.Tests/AggregateFluentTests.cs
  50. +1 −1 tests/MongoDB.Driver.Tests/AggregateGraphLookupEnumerableFromOrToTests.cs
  51. +1 −0 tests/MongoDB.Driver.Tests/AsyncCursorTests.cs
  52. +1 −0 tests/MongoDB.Driver.Tests/AuthenticationTests.cs
  53. +1 −0 tests/MongoDB.Driver.Tests/CausalConsistencyTests.cs
  54. +1 −0 tests/MongoDB.Driver.Tests/ClientDocumentHelperTests.cs
  55. +1 −0 tests/MongoDB.Driver.Tests/ClusterTests.cs
  56. +1 −0 tests/MongoDB.Driver.Tests/ConnectionsSurvivePrimaryStepDownTests.cs
  57. +11 −52 tests/MongoDB.Driver.Tests/Core/Bindings/CoreServerSessionPoolTests.cs
  58. +1 −0 tests/MongoDB.Driver.Tests/Core/Bindings/CoreSessionTests.cs
  59. +84 −37 tests/MongoDB.Driver.Tests/Core/Connections/BinaryConnectionTests.cs
  60. +1 −0 tests/MongoDB.Driver.Tests/Core/Connections/TcpStreamFactoryTests.cs
  61. +191 −0 tests/MongoDB.Driver.Tests/Core/Misc/TaskExtensionsTests.cs
  62. +1 −0 tests/MongoDB.Driver.Tests/Core/Misc/WireVersionTests.cs
  63. +0 −176 tests/MongoDB.Driver.Tests/Core/Operations/InsertOpcodeOperationTests.cs
  64. +1 −0 tests/MongoDB.Driver.Tests/Core/Operations/OperationTestBase.cs
  65. +0 −64 tests/MongoDB.Driver.Tests/Core/Operations/UpdateOpcodeOperationTests.cs
  66. +1 −0 tests/MongoDB.Driver.Tests/Core/Servers/ServerTests.cs
  67. +1 −0 tests/MongoDB.Driver.Tests/CustomServerSelectorTests.cs
  68. +1 −0 tests/MongoDB.Driver.Tests/Encryption/AutoEncryptionTests.cs
  69. +1 −0 tests/MongoDB.Driver.Tests/Encryption/ClientEncryptionTests.cs
  70. +2 −0 tests/MongoDB.Driver.Tests/FilterDefinitionBuilderTests.cs
  71. +1 −3 tests/MongoDB.Driver.Tests/FindFluentTests.cs
  72. +3 −0 tests/MongoDB.Driver.Tests/GridFS/GridFSBucketTests.cs
  73. +2 −0 tests/MongoDB.Driver.Tests/GridFS/GridFSDownloadStreamBaseTests.cs
  74. +1 −0 tests/MongoDB.Driver.Tests/GridFS/GridFSSeekableDownloadStreamTests.cs
  75. +1 −0 tests/MongoDB.Driver.Tests/GridFS/GridFSUploadStreamTests.cs
  76. +1 −0 tests/MongoDB.Driver.Tests/Jira/CSharp2564Tests.cs
  77. +1 −2 tests/MongoDB.Driver.Tests/Jira/CSharp2622Tests.cs
  78. +6 −26 tests/MongoDB.Driver.Tests/Jira/CSharp3188Tests.cs
  79. +1 −0 tests/MongoDB.Driver.Tests/Jira/CSharp3225Tests.cs
  80. +1 −1 tests/MongoDB.Driver.Tests/Jira/CSharp3397Tests.cs
  81. +47 −0 tests/MongoDB.Driver.Tests/Jira/CSharp4040Tests.cs
  82. +1 −0 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp1486Tests.cs
  83. +1 −0 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp1771Tests.cs
  84. +1 −0 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2071Tests.cs
  85. +1 −0 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2308Tests.cs
  86. +1 −0 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2422Tests.cs
  87. +1 −1 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2708Tests.cs
  88. +1 −1 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2723Tests.cs
  89. +1 −0 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3283Tests.cs
  90. +1 −0 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3425Tests.cs
  91. +112 −0 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3435Tests.cs
  92. +1 −0 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3524Tests.cs
  93. +1 −0 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3630Tests.cs
  94. +1 −0 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3713Tests.cs
  95. +1 −1 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3865Tests.cs
  96. +1 −0 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3910Tests.cs
  97. +1 −1 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3933Tests.cs
  98. +1 −0 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3940Tests.cs
  99. +2 −1 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Linq3IntegrationTest.cs
  100. +1 −0 tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/MongoQueryProviderTests.cs
  101. +2 −0 tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/IntegrationTestBase.cs
  102. +1 −0 ...goDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableEnumComparedToEnumTests.cs
  103. +1 −0 ...inq3ImplementationWithLinq2Tests/MongoQueryableEnumComparedToEnumWithStringRepresentationTests.cs
  104. +1 −0 ...ests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntArrayComparedToEnumerableIntTests.cs
  105. +1 −0 ...oDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToDoubleTests.cs
  106. +1 −0 ...nq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToDoubleWithStringRepresentationTests.cs
  107. +1 −0 ...river.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToNullableIntTests.cs
  108. +1 −0 ...plementationWithLinq2Tests/MongoQueryableIntComparedToNullableIntWithStringRepresentationTests.cs
  109. +1 −0 ...s/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableNullableEnumComparedToNullableEnumTests.cs
  110. +1 −0 ...onWithLinq2Tests/MongoQueryableNullableEnumComparedToNullableEnumWithStringRepresentationTests.cs
  111. +1 −0 ...MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableWithDotNotationTests.cs
  112. +1 −1 ...Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/Translators/LegacyPredicateTranslatorTests.cs
  113. +1 −1 ...er.Tests/Linq/Linq3ImplementationWithLinq2Tests/Translators/PredicateTranslatorValidationTests.cs
  114. +1 −0 tests/MongoDB.Driver.Tests/ListDatabasesTests.cs
  115. +2 −2 tests/MongoDB.Driver.Tests/LoggingTests.cs
  116. +1 −0 tests/MongoDB.Driver.Tests/MongoClientSettingsTests.cs
  117. +1 −0 tests/MongoDB.Driver.Tests/MongoClientTests.cs
  118. +1 −0 tests/MongoDB.Driver.Tests/MongoCollectionImplTests.cs
  119. +1 −0 tests/MongoDB.Driver.Tests/MongoCredentialTests.cs
  120. +0 −4 tests/MongoDB.Driver.Tests/MongoDB.Driver.Tests.csproj
  121. +2 −0 tests/MongoDB.Driver.Tests/MongoDatabasTests.cs
  122. +1 −0 tests/MongoDB.Driver.Tests/MongoIndexManagerTests.cs
  123. +1 −0 tests/MongoDB.Driver.Tests/OfTypeMongoCollectionTests.cs
  124. +1 −1 tests/MongoDB.Driver.Tests/PinnedShardRouterTests.cs
  125. +18 −17 tests/MongoDB.Driver.Tests/PipelineDefinitionBuilderTests.cs
  126. +19 −18 tests/MongoDB.Driver.Tests/PipelineStageDefinitionBuilderTests.cs
  127. +1 −0 tests/MongoDB.Driver.Tests/ReadPreferenceOnStandaloneTests.cs
  128. +1 −0 tests/MongoDB.Driver.Tests/RetryableWritesTests.cs
  129. +1 −0 tests/MongoDB.Driver.Tests/Samples/AggregationSample.cs
  130. +31 −54 tests/MongoDB.Driver.Tests/Search/AtlasSearchTests.cs
  131. +1 −0 tests/MongoDB.Driver.Tests/Search/MongoQueryableTests.cs
  132. +1 −0 tests/MongoDB.Driver.Tests/Search/VectorSearchTests.cs
  133. +1 −3 tests/MongoDB.Driver.Tests/Specifications/UnifiedTestSpecRunner.cs
  134. +1 −0 tests/MongoDB.Driver.Tests/Specifications/change-streams/prose-tests/ChangeStreamProseTests.cs
  135. +1 −0 tests/MongoDB.Driver.Tests/Specifications/client-side-encryption/ClientSideEncryptionTestRunner.cs
  136. +1 −0 ...goDB.Driver.Tests/Specifications/client-side-encryption/prose-tests/ClientEncryptionProseTests.cs
  137. +1 −0 ...ests/Specifications/connection-monitoring-and-pooling/ConnectionMonitoringAndPoolingTestRunner.cs
  138. +1 −0 tests/MongoDB.Driver.Tests/Specifications/crud/CrudTestRunner.cs
  139. +1 −0 tests/MongoDB.Driver.Tests/Specifications/crud/prose-tests/CrudProseTests.cs
  140. +1 −0 ...iver.Tests/Specifications/initial-dns-seedlist-discovery/InitialDnsSeedlistDiscoveryTestRunner.cs
  141. +1 −0 tests/MongoDB.Driver.Tests/Specifications/retryable-reads/RetryableReadsProseTests.cs
  142. +1 −0 tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/MMapV1Tests.cs
  143. +1 −0 tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/PoolClearRetryability.cs
  144. +1 −0 tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/RetryWriteOnOtherMongos.cs
  145. +2 −2 ...er.Tests/Specifications/server-discovery-and-monitoring/ServerDiscoveryAndMonitoringProseTests.cs
  146. +1 −0 ...ver.Tests/Specifications/server-discovery-and-monitoring/prose-tests/ServerDiscoveryProseTests.cs
  147. +1 −0 tests/MongoDB.Driver.Tests/Specifications/sessions/SessionsProseTests.cs
  148. +1 −0 tests/MongoDB.Driver.Tests/Specifications/uuid/prose-tests/ImplicitEncodingTests.cs
  149. +1 −0 tests/MongoDB.TestHelpers/MongoDB.TestHelpers.csproj
  150. +0 −25 tests/MongoDB.TestHelpers/XunitExtensions/IntegrationTestAttribute.cs
  151. +1 −0 tests/SmokeTests/MongoDB.Driver.SmokeTests.Sdk/LibmongocryptTests.cs
  152. +1 −0 tests/SmokeTests/MongoDB.Driver.SmokeTests.Sdk/LoggingTests.cs
31 changes: 31 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Pull Request validation

on:
pull_request:
types:
- opened
- reopened
- edited
- labeled
- unlabeled
- synchronize

jobs:
pull-request-validation:
name: Pull Request validation.
runs-on: ubuntu-latest
steps:
- name: Pull Request should have a label assigned.
if: ${{ always() && github.event.pull_request.labels[0] == null }}
run: |
exit 1
- name: Title should start with a Jira ticket.
if: ${{ always() && !(startsWith(github.event.pull_request.title, 'CSHARP-')) }}
run: |
exit 1
- name: Title should not end with period or ellipses.
if: ${{ always() && (endsWith(github.event.pull_request.title, '.') || endsWith(github.event.pull_request.title, '…')) }}
run: |
exit 1
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
MongoDB C# Driver
=================

You can get the latest stable release from the [official Nuget.org feed](https://www.nuget.org/packages/MongoDB.Driver) or from our [github releases page](https://github.com/mongodb/mongo-csharp-driver/releases).
[![MongoDB.Driver](https://img.shields.io/nuget/v/MongoDB.Driver.svg)](https://www.nuget.org/packages/MongoDB.Driver/)
[![Documentation](https://img.shields.io/badge/docs-docfx-blue.svg)](https://mongodb.github.io/mongo-csharp-driver/3.4.0/api/index.html)
[![Documentation](https://img.shields.io/badge/docs-mongo-green.svg)](https://www.mongodb.com/docs/drivers/csharp/current/)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/mongodb/mongo-csharp-driver/blob/main/LICENSE.md)

The official MongoDB .NET/C# driver.

The MongoDB .NET/C# driver follows [semantic versioning](https://semver.org/) since v3.0.0 of its releases.

Getting Started
---------------
@@ -62,7 +69,8 @@ foreach(var person in list)
Documentation
-------------
* [MongoDB](https://www.mongodb.com/docs)
* [Documentation](https://www.mongodb.com/docs/drivers/csharp/current/)
* [.NET/C# Driver](https://www.mongodb.com/docs/drivers/csharp/current/)
* [API Reference](https://mongodb.github.io/mongo-csharp-driver/3.4.0/api/index.html)

Questions/Bug Reports
---------------------
8 changes: 1 addition & 7 deletions build.cake
Original file line number Diff line number Diff line change
@@ -117,12 +117,6 @@ Task("Test")
items: GetFiles("./**/*.Tests.csproj").Where(name => !name.ToString().Contains("Atlas")),
action: (BuildConfig buildConfig, Path testProject) =>
{
if (Environment.GetEnvironmentVariable("MONGODB_API_VERSION") != null &&
testProject.ToString().Contains("Legacy"))
{
return; // Legacy tests are exempt from Version API testing
}

var mongoX509ClientCertificatePath = Environment.GetEnvironmentVariable("MONGO_X509_CLIENT_CERTIFICATE_PATH");
if (mongoX509ClientCertificatePath != null)
{
@@ -134,7 +128,7 @@ Task("Test")
Console.WriteLine($"MONGO_X509_CLIENT_CERTIFICATE_PASSWORD={mongoX509ClientCertificatePassword}");
}

RunTests(buildConfig, testProject);
RunTests(buildConfig, testProject, filter: "Category=\"Integration\"");
})
.DeferOnError();

6 changes: 2 additions & 4 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -89,17 +89,16 @@ if($FoundDotNetCliVersion -ne $DotNetVersion) {
New-Item -Path $InstallPath -ItemType Directory -Force | Out-Null;
}

# N.B. We explicitly install .NET Core 2.1 and 3.1 because .NET 5.0 SDK can build those TFMs
# N.B. We explicitly install .NET Core 3.1 because .NET 5.0 SDK can build those TFMs
# but will silently upgrade to a more recent runtime to execute tests if the desired runtime
# isn't available. For example, `dotnet run --framework netcoreapp3.0` will silently run
# on .NET 5.0 if .NET Core 3.0 and 3.1 aren't installed.
# This solution is admittedly hacky as .NET Core 2.1 and 3.1 won't be installed if
# This solution is admittedly hacky as .NET Core 3.1 won't be installed if
# $DOTNET_VERSION matches $DOTNET_INSTALLED_VERSION, but it minimizes the changes required
# to install required dependencies on Evergreen.
if ($IsMacOS -or $IsLinux) {
$ScriptPath = Join-Path $InstallPath 'dotnet-install.sh'
(New-Object System.Net.WebClient).DownloadFile($DotNetUnixInstallerUri, $ScriptPath);
& 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 6.0 --no-path
@@ -111,7 +110,6 @@ if($FoundDotNetCliVersion -ne $DotNetVersion) {
else {
$ScriptPath = Join-Path $InstallPath 'dotnet-install.ps1'
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, $ScriptPath);
& $ScriptPath -Channel 2.1 -InstallDir $InstallPath;
& $ScriptPath -Channel 3.1 -InstallDir $InstallPath;
& $ScriptPath -Channel 5.0 -InstallDir $InstallPath;
& $ScriptPath -Channel 6.0 -InstallDir $InstallPath;
5 changes: 2 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
@@ -33,18 +33,17 @@ if [ "$DOTNET_VERSION" != "$DOTNET_INSTALLED_VERSION" ]; then
mkdir "$SCRIPT_DIR/.dotnet"
fi
curl -Lfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.sh
# N.B. We explicitly install .NET Core 2.1 and 3.1 because .NET 6.0 SDK can build those TFMs
# N.B. We explicitly install .NET Core 3.1 because .NET 6.0 SDK can build those TFMs
# but will silently upgrade to a more recent runtime to execute tests if the desired runtime
# isn't available. For example, `dotnet run --framework netcoreapp3.0` will silently run
# on .NET 6.0 if .NET Core 3.0 and 3.1 aren't installed.
# This solution is admittedly hacky as .NET Core 2.1 and 3.1 won't be installed if
# This solution is admittedly hacky as .NET Core 3.1 won't be installed if
# $DOTNET_VERSION matches $DOTNET_INSTALLED_VERSION, but it minimizes the changes required
# to install required dependencies on Evergreen.
# Since ARM64 support was first added in .NET 6.0, the following commands will install:
# | CPU | 2.1 | 3.1 | Latest |
# | x64 | x64 | x64 | x64 |
# | arm64 | x64 | x64 | arm64 |
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 6.0 --install-dir .dotnet --no-path
135 changes: 132 additions & 3 deletions evergreen/evergreen.yml
Original file line number Diff line number Diff line change
@@ -98,9 +98,13 @@ functions:
install-dotnet:
- command: shell.exec
params:
include_expansions_in_env:
- "OS"
- "DOTNET_SDK_VERSION"
- "FRAMEWORK"
script: |
${PREPARE_SHELL}
OS=${OS} DOTNET_SDK_VERSION=${DOTNET_SDK_VERSION} bash ${PROJECT_DIRECTORY}/evergreen/install-dotnet.sh
bash ${PROJECT_DIRECTORY}/evergreen/install-dotnet.sh
prepare-resources:
- command: shell.exec
@@ -314,6 +318,10 @@ functions:
bootstrap-mongohoused:
- command: shell.exec
params:
include_expansions_in_env:
- "AWS_ACCESS_KEY_ID"
- "AWS_SECRET_ACCESS_KEY"
- "AWS_SESSION_TOKEN"
script: |
DRIVERS_TOOLS="${DRIVERS_TOOLS}" bash ${DRIVERS_TOOLS}/.evergreen/atlas_data_lake/pull-mongohouse-image.sh
- command: shell.exec
@@ -352,6 +360,18 @@ functions:
cd ${DRIVERS_TOOLS}/.evergreen
DRIVERS_TOOLS=${DRIVERS_TOOLS} MONGODB_URI=${MONGODB_URI} bash ${DRIVERS_TOOLS}/.evergreen/run-load-balancer.sh stop
run-unit-tests:
- command: shell.exec
type: test
params:
working_dir: mongo-csharp-driver
shell: "bash"
include_expansions_in_env:
- "FRAMEWORK"
script: |
${PREPARE_SHELL}
bash evergreen/run-unit-tests.sh
run-tests:
- command: shell.exec
type: test
@@ -439,6 +459,10 @@ functions:
params:
shell: "bash"
working_dir: mongo-csharp-driver
include_expansions_in_env:
- "AWS_ACCESS_KEY_ID"
- "AWS_SECRET_ACCESS_KEY"
- "AWS_SESSION_TOKEN"
script: |
. ${DRIVERS_TOOLS}/.evergreen/secrets_handling/setup-secrets.sh drivers/atlas_connect
. evergreen/run-atlas-connectivity-tests.sh
@@ -476,9 +500,38 @@ functions:
script: |
${PREPARE_SHELL}
MONGODB_URI="${MONGODB_URI}" ../../evergreen/run-perf-tests.sh
- command: perf.send
- command: shell.exec
params:
file: mongo-csharp-driver/benchmarks/MongoDB.Driver.Benchmarks/Benchmark.Artifacts/results/evergreen-results.json
script: |
# We use the requester expansion to determine whether the data is from a mainline evergreen run or not
if [ "${requester}" == "commit" ]; then
is_mainline=true
else
is_mainline=false
fi
# We parse the username out of the order_id as patches append that in and SPS does not need that information
parsed_order_id=$(echo "${revision_order_id}" | awk -F'_' '{print $NF}')
# Submit the performance data to the SPS endpoint
response=$(curl -s -w "\nHTTP_STATUS:%{http_code}" -X 'POST' \
"https://performance-monitoring-api.corp.mongodb.com/raw_perf_results/cedar_report?project=${project_id}&version=${version_id}&variant=${build_variant}&order=$parsed_order_id&task_name=${task_name}&task_id=${task_id}&execution=${execution}&mainline=$is_mainline" \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d @mongo-csharp-driver/benchmarks/MongoDB.Driver.Benchmarks/Benchmark.Artifacts/results/evergreen-results.json)
http_status=$(echo "$response" | grep "HTTP_STATUS" | awk -F':' '{print $2}')
response_body=$(echo "$response" | sed '/HTTP_STATUS/d')
# We want to throw an error if the data was not successfully submitted
if [ "$http_status" -ne 200 ]; then
echo "Error: Received HTTP status $http_status"
echo "Response Body: $response_body"
exit 1
fi
echo "Response Body: $response_body"
echo "HTTP Status: $http_status"
assume-ec2-role:
- command: ec2.assume_role
@@ -1002,6 +1055,36 @@ post:
- func: cleanup

tasks:
- name: unit-tests-net472
commands:
- command: expansions.update
params:
updates:
- key: 'FRAMEWORK'
value: 'net472'
- func: install-dotnet
- func: run-unit-tests

- name: unit-tests-netstandard21
commands:
- command: expansions.update
params:
updates:
- key: 'FRAMEWORK'
value: 'netstandard2.1'
- func: install-dotnet
- func: run-unit-tests

- name: unit-tests-net60
commands:
- command: expansions.update
params:
updates:
- key: 'FRAMEWORK'
value: 'net6.0'
- func: install-dotnet
- func: run-unit-tests

- name: test-net472
commands:
- func: setup-csfle-secrets
@@ -1183,6 +1266,7 @@ tasks:

- name: atlas-data-lake-test
commands:
- func: assume-ec2-role
- func: bootstrap-mongohoused
- func: run-atlas-data-lake-test

@@ -1968,9 +2052,14 @@ task_groups:
setup_group:
- func: fetch-source
- func: prepare-resources
- func: assume-ec2-role
- command: subprocess.exec
params:
binary: bash
include_expansions_in_env:
- "AWS_ACCESS_KEY_ID"
- "AWS_SECRET_ACCESS_KEY"
- "AWS_SESSION_TOKEN"
env:
LAMBDA_STACK_NAME: dbx-csharp-lambda
args:
@@ -2110,6 +2199,10 @@ task_groups:
binary: bash
env:
VAULT_NAME: ${VAULT_NAME}
include_expansions_in_env:
- "AWS_ACCESS_KEY_ID"
- "AWS_SECRET_ACCESS_KEY"
- "AWS_SESSION_TOKEN"
args:
- ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh
- command: expansions.update
@@ -2150,6 +2243,42 @@ task_groups:
- validate-apicompat

buildvariants:
- name: unit-tests-windows
display_name: Unit Tests on Windows
run_on: windows-64-vs2017-test
expansions:
OS: "windows-64"
tasks:
- name: unit-tests-net472
- name: unit-tests-netstandard21
- name: unit-tests-net60

- name: unit-tests-ubuntu
display_name: Unit Tests on Ubuntu
run_on: ubuntu2004-small
expansions:
OS: "ubuntu-2004"
tasks:
- name: unit-tests-netstandard21
- name: unit-tests-net60

- name: unit-tests-macos
display_name: Unit Tests on MacOs
run_on: macos-14
expansions:
OS: "macos-14"
tasks:
- name: unit-tests-netstandard21
- name: unit-tests-net60

- name: unit-tests-macos-arm
display_name: Unit Tests on MacOs Arm
run_on: macos-14-arm64
expansions:
OS: "macos-14-arm64"
tasks:
- name: unit-tests-net60

- matrix_name: stable-api-tests
matrix_spec: { version: ["5.0", "6.0", "7.0", "8.0", "rapid", "latest"], topology: "standalone", auth: "auth", ssl: "nossl", os: "windows-64" }
display_name: "Stable API ${version} ${topology} ${auth} ${ssl} ${os}"
22 changes: 20 additions & 2 deletions evergreen/install-dotnet.sh
Original file line number Diff line number Diff line change
@@ -4,14 +4,32 @@ set -o errexit # Exit the script with error if any of the commands fail
DOTNET_SDK_PATH="${DOTNET_SDK_PATH:-./.dotnet}"
DOTNET_SDK_VERSION="${DOTNET_SDK_VERSION:-8.0}"

echo "runtime: $FRAMEWORK"

if [ -n "$FRAMEWORK" ]; then
if [ "$FRAMEWORK" = "net6.0" ]; then
RUNTIME_VERSION="6.0"
elif [ "$FRAMEWORK" = "netstandard2.1" ]; then
RUNTIME_VERSION="3.1"
fi
fi

if [[ $OS =~ [Ww]indows.* ]]; then
echo "Downloading Windows .NET SDK installer into $DOTNET_SDK_PATH folder..."
curl -Lfo ./dotnet-install.ps1 https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.ps1
echo "Installing .NET 8.0 SDK..."
echo "Installing .NET ${DOTNET_SDK_VERSION} SDK..."
powershell.exe ./dotnet-install.ps1 -Channel "$DOTNET_SDK_VERSION" -InstallDir "$DOTNET_SDK_PATH" -NoPath
if [ -n "$RUNTIME_VERSION" ]; then
echo "Installing .NET ${RUNTIME_VERSION} runtime..."
powershell.exe ./dotnet-install.ps1 -Channel "$RUNTIME_VERSION" -Runtime dotnet -InstallDir "$DOTNET_SDK_PATH" -NoPath
fi
else
echo "Downloading .NET SDK installer into $DOTNET_SDK_PATH folder..."
curl -Lfo ./dotnet-install.sh https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.sh
echo "Installing .NET 8.0 SDK..."
echo "Installing .NET ${DOTNET_SDK_VERSION} SDK..."
bash ./dotnet-install.sh --channel "$DOTNET_SDK_VERSION" --install-dir "$DOTNET_SDK_PATH" --no-path
if [ -n "$RUNTIME_VERSION" ]; then
echo "Installing .NET ${RUNTIME_VERSION} runtime..."
bash ./dotnet-install.sh --channel "$RUNTIME_VERSION" --runtime dotnet --install-dir "$DOTNET_SDK_PATH" --no-path
fi
fi
Loading