From df1a468448664e3e5058f712da71e0f39c8531f1 Mon Sep 17 00:00:00 2001 From: Oleksandr Poliakov Date: Fri, 16 May 2025 17:36:15 -0700 Subject: [PATCH 1/4] CSHARP-5592: Separate unit tests into dedicated variants --- build.cake | 2 +- evergreen/evergreen.yml | 69 ++++++++++++++++++- evergreen/install-dotnet.sh | 22 +++++- evergreen/run-unit-tests.sh | 11 +++ .../ConnectivityTests.cs | 1 + .../MongoDB.Bson.TestHelpers.csproj | 1 + .../Aws/AwsAuthenticationExamples.cs | 1 + .../CausalConsistencyExamples.cs | 1 + .../ChangeStreamExamples.cs | 1 + .../ClientEncryptionExamples.cs | 1 + .../ClientSideEncryption2Examples.cs | 1 + .../DocumentationExamples.cs | 31 +++++---- .../ExplicitEncryptionExamples.cs | 1 + .../PrimerTestFixture.cs | 2 + .../StableApiExamples.cs | 1 + .../WithTransactionExample1.cs | 1 + .../IntegrationTest.cs | 2 +- .../MongoDB.Driver.TestHelpers.csproj | 1 + .../AggregateFluentFacetTests.cs | 2 +- ...tGraphLookupWithAirportsCollectionTests.cs | 1 + ...tGraphLookupWithEmployeeCollectionTests.cs | 1 + .../AggregateFluentTests.cs | 1 + ...egateGraphLookupEnumerableFromOrToTests.cs | 2 +- .../MongoDB.Driver.Tests/AsyncCursorTests.cs | 1 + .../AuthenticationTests.cs | 1 + .../CausalConsistencyTests.cs | 1 + .../ClientDocumentHelperTests.cs | 1 + tests/MongoDB.Driver.Tests/ClusterTests.cs | 1 + .../ConnectionsSurvivePrimaryStepDownTests.cs | 1 + .../Core/Bindings/CoreSessionTests.cs | 1 + .../Core/Connections/TcpStreamFactoryTests.cs | 1 + .../Core/Misc/WireVersionTests.cs | 1 + .../Core/Operations/OperationTestBase.cs | 1 + .../Core/Servers/ServerTests.cs | 1 + .../CustomServerSelectorTests.cs | 1 + .../Encryption/AutoEncryptionTests.cs | 1 + .../Encryption/ClientEncryptionTests.cs | 1 + .../FilterDefinitionBuilderTests.cs | 2 + tests/MongoDB.Driver.Tests/FindFluentTests.cs | 4 +- .../GridFS/GridFSBucketTests.cs | 3 + .../GridFS/GridFSDownloadStreamBaseTests.cs | 2 + .../GridFSSeekableDownloadStreamTests.cs | 1 + .../GridFS/GridFSUploadStreamTests.cs | 1 + .../Jira/CSharp2564Tests.cs | 1 + .../Jira/CSharp2622Tests.cs | 3 +- .../Jira/CSharp3188Tests.cs | 1 + .../Jira/CSharp3225Tests.cs | 1 + .../Jira/CSharp3397Tests.cs | 2 +- .../Jira/CSharp1486Tests.cs | 1 + .../Jira/CSharp1771Tests.cs | 1 + .../Jira/CSharp2071Tests.cs | 1 + .../Jira/CSharp2308Tests.cs | 1 + .../Jira/CSharp2422Tests.cs | 1 + .../Jira/CSharp2708Tests.cs | 2 +- .../Jira/CSharp2723Tests.cs | 2 +- .../Jira/CSharp3283Tests.cs | 1 + .../Jira/CSharp3425Tests.cs | 1 + .../Jira/CSharp3524Tests.cs | 1 + .../Jira/CSharp3630Tests.cs | 1 + .../Jira/CSharp3713Tests.cs | 1 + .../Jira/CSharp3865Tests.cs | 2 +- .../Jira/CSharp3910Tests.cs | 1 + .../Jira/CSharp3933Tests.cs | 2 +- .../Jira/CSharp3940Tests.cs | 1 + .../Linq3IntegrationTest.cs | 3 +- .../MongoQueryProviderTests.cs | 1 + .../IntegrationTestBase.cs | 2 + .../MongoQueryableEnumComparedToEnumTests.cs | 2 + ...aredToEnumWithStringRepresentationTests.cs | 2 + ...bleIntArrayComparedToEnumerableIntTests.cs | 2 + .../MongoQueryableIntComparedToDoubleTests.cs | 2 + ...edToDoubleWithStringRepresentationTests.cs | 2 + ...oQueryableIntComparedToNullableIntTests.cs | 2 + ...ullableIntWithStringRepresentationTests.cs | 2 + ...NullableEnumComparedToNullableEnumTests.cs | 2 + ...llableEnumWithStringRepresentationTests.cs | 2 + .../MongoQueryableWithDotNotationTests.cs | 2 + .../LegacyPredicateTranslatorTests.cs | 2 + .../PredicateTranslatorValidationTests.cs | 5 +- .../ListDatabasesTests.cs | 1 + tests/MongoDB.Driver.Tests/LoggingTests.cs | 4 +- .../MongoClientSettingsTests.cs | 1 + .../MongoDB.Driver.Tests/MongoClientTests.cs | 1 + .../MongoCollectionImplTests.cs | 1 + .../MongoCredentialTests.cs | 1 + .../MongoDB.Driver.Tests/MongoDatabasTests.cs | 2 + .../MongoIndexManagerTests.cs | 1 + .../OfTypeMongoCollectionTests.cs | 1 + .../PinnedShardRouterTests.cs | 2 +- .../PipelineDefinitionBuilderTests.cs | 35 +++++----- .../PipelineStageDefinitionBuilderTests.cs | 47 ++++++++----- .../ReadPreferenceOnStandaloneTests.cs | 1 + .../RetryableWritesTests.cs | 1 + .../Samples/AggregationSample.cs | 1 + .../Search/MongoQueryableTests.cs | 1 + .../Search/VectorSearchTests.cs | 1 + .../Specifications/UnifiedTestSpecRunner.cs | 1 + .../prose-tests/ChangeStreamProseTests.cs | 1 + .../ClientSideEncryptionTestRunner.cs | 1 + .../prose-tests/ClientEncryptionProseTests.cs | 1 + ...onnectionMonitoringAndPoolingTestRunner.cs | 1 + .../Specifications/crud/CrudTestRunner.cs | 1 + .../crud/prose-tests/CrudProseTests.cs | 1 + .../InitialDnsSeedlistDiscoveryTestRunner.cs | 1 + .../RetryableReadsProseTests.cs | 1 + .../prose-tests/MMapV1Tests.cs | 1 + .../prose-tests/PoolClearRetryability.cs | 1 + .../prose-tests/RetryWriteOnOtherMongos.cs | 2 + .../ServerDiscoveryAndMonitoringProseTests.cs | 2 +- .../prose-tests/ServerDiscoveryProseTests.cs | 1 + .../sessions/SessionsProseTests.cs | 1 + .../uuid/prose-tests/ImplicitEncodingTests.cs | 1 + .../MongoDB.TestHelpers.csproj | 1 + .../IntegrationTestAttribute.cs | 25 ------- .../LibmongocryptTests.cs | 1 + .../LoggingTests.cs | 1 + 116 files changed, 293 insertions(+), 100 deletions(-) create mode 100644 evergreen/run-unit-tests.sh delete mode 100644 tests/MongoDB.TestHelpers/XunitExtensions/IntegrationTestAttribute.cs diff --git a/build.cake b/build.cake index 9c50bb96ffe..4c569d539c3 100644 --- a/build.cake +++ b/build.cake @@ -128,7 +128,7 @@ Task("Test") Console.WriteLine($"MONGO_X509_CLIENT_CERTIFICATE_PASSWORD={mongoX509ClientCertificatePassword}"); } - RunTests(buildConfig, testProject); + RunTests(buildConfig, testProject, filter: "Category=\"Integration\""); }) .DeferOnError(); diff --git a/evergreen/evergreen.yml b/evergreen/evergreen.yml index 8cbf5c9ba40..7dad720af02 100644 --- a/evergreen/evergreen.yml +++ b/evergreen/evergreen.yml @@ -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 @@ -352,6 +356,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 @@ -508,7 +524,7 @@ functions: echo "Response Body: $response_body" echo "HTTP Status: $http_status" - + assume-ec2-role: - command: ec2.assume_role params: @@ -1031,6 +1047,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 @@ -2179,6 +2225,25 @@ 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 + - 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}" diff --git a/evergreen/install-dotnet.sh b/evergreen/install-dotnet.sh index 230eb2ab5bd..0112e960200 100644 --- a/evergreen/install-dotnet.sh +++ b/evergreen/install-dotnet.sh @@ -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 diff --git a/evergreen/run-unit-tests.sh b/evergreen/run-unit-tests.sh new file mode 100644 index 00000000000..397d5bb6701 --- /dev/null +++ b/evergreen/run-unit-tests.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -o errexit # Exit the script with error if any of the commands fail + +FRAMEWORK=${FRAMEWORK:-net6.0} + +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" diff --git a/tests/AtlasConnectivity.Tests/ConnectivityTests.cs b/tests/AtlasConnectivity.Tests/ConnectivityTests.cs index b5729dd8d4c..96cb70134dc 100644 --- a/tests/AtlasConnectivity.Tests/ConnectivityTests.cs +++ b/tests/AtlasConnectivity.Tests/ConnectivityTests.cs @@ -23,6 +23,7 @@ namespace AtlasConnectivity.Tests { + [Trait("Category", "Integration")] public class ConnectivityTests : LoggableTestClass { // public constructors diff --git a/tests/MongoDB.Bson.TestHelpers/MongoDB.Bson.TestHelpers.csproj b/tests/MongoDB.Bson.TestHelpers/MongoDB.Bson.TestHelpers.csproj index 00789c4be93..e37dbff7c1b 100644 --- a/tests/MongoDB.Bson.TestHelpers/MongoDB.Bson.TestHelpers.csproj +++ b/tests/MongoDB.Bson.TestHelpers/MongoDB.Bson.TestHelpers.csproj @@ -2,6 +2,7 @@ + false ..\..\MongoDBLegacyTest.ruleset diff --git a/tests/MongoDB.Driver.Examples/Aws/AwsAuthenticationExamples.cs b/tests/MongoDB.Driver.Examples/Aws/AwsAuthenticationExamples.cs index 8537d73e500..bba5b707e9d 100644 --- a/tests/MongoDB.Driver.Examples/Aws/AwsAuthenticationExamples.cs +++ b/tests/MongoDB.Driver.Examples/Aws/AwsAuthenticationExamples.cs @@ -53,6 +53,7 @@ namespace MongoDB.Driver.Examples.Aws /// 4. To work with EC2 container credentials from EC2 instance metadata make sure a test is launched on EC2 env and AWS_CONTAINER_CREDENTIALS_* is not set /// 5. To work with Aws WebIdentityToken make sure that AWS_WEB_IDENTITY_TOKEN_FILE, AWS_ROLE_ARN and AWS_ROLE_SESSION_NAME are configured /// + [Trait("Category", "Integration")] public class AwsAuthenticationExamples { private static readonly string __connectionStringHosts = ""; diff --git a/tests/MongoDB.Driver.Examples/CausalConsistencyExamples.cs b/tests/MongoDB.Driver.Examples/CausalConsistencyExamples.cs index da6a023a678..a2c1e5a069b 100644 --- a/tests/MongoDB.Driver.Examples/CausalConsistencyExamples.cs +++ b/tests/MongoDB.Driver.Examples/CausalConsistencyExamples.cs @@ -22,6 +22,7 @@ namespace MongoDB.Driver.Examples { + [Trait("Category", "Integration")] public class CausalConsistencyExamples { [Fact] diff --git a/tests/MongoDB.Driver.Examples/ChangeStreamExamples.cs b/tests/MongoDB.Driver.Examples/ChangeStreamExamples.cs index d3731364c1f..730dfe80d1f 100644 --- a/tests/MongoDB.Driver.Examples/ChangeStreamExamples.cs +++ b/tests/MongoDB.Driver.Examples/ChangeStreamExamples.cs @@ -25,6 +25,7 @@ namespace MongoDB.Driver.Examples { + [Trait("Category", "Integration")] public class ChangeStreamExamples { [Fact] diff --git a/tests/MongoDB.Driver.Examples/ClientEncryptionExamples.cs b/tests/MongoDB.Driver.Examples/ClientEncryptionExamples.cs index ae7560e42a6..a2c7a54051f 100644 --- a/tests/MongoDB.Driver.Examples/ClientEncryptionExamples.cs +++ b/tests/MongoDB.Driver.Examples/ClientEncryptionExamples.cs @@ -25,6 +25,7 @@ namespace MongoDB.Driver.Examples { + [Trait("Category", "Integration")] public class ClientEncryptionExamples { private const string LocalMasterKey = "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk"; diff --git a/tests/MongoDB.Driver.Examples/ClientSideEncryption2Examples.cs b/tests/MongoDB.Driver.Examples/ClientSideEncryption2Examples.cs index 0782fad3fd1..2524e5cb378 100644 --- a/tests/MongoDB.Driver.Examples/ClientSideEncryption2Examples.cs +++ b/tests/MongoDB.Driver.Examples/ClientSideEncryption2Examples.cs @@ -27,6 +27,7 @@ namespace MongoDB.Driver.Examples { + [Trait("Category", "Integration")] public class ClientSideEncryption2Examples { private const string LocalMasterKey = "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk"; diff --git a/tests/MongoDB.Driver.Examples/DocumentationExamples.cs b/tests/MongoDB.Driver.Examples/DocumentationExamples.cs index 4ce1ca6f8a8..5903574dcd0 100644 --- a/tests/MongoDB.Driver.Examples/DocumentationExamples.cs +++ b/tests/MongoDB.Driver.Examples/DocumentationExamples.cs @@ -23,6 +23,7 @@ namespace MongoDB.Driver.Examples { + [Trait("Category", "Integration")] public class DocumentationExamples { private readonly IMongoClient client; @@ -41,7 +42,7 @@ public DocumentationExamples() [Fact] public void Example_1() { - // db.inventory.insertOne( { item: "canvas", qty: 100, tags: ["cotton"], size: { h: 28, w: 35.5, uom: "cm" } } ) + // db.inventory.insertOne( { item: "canvas", qty: 100, tags: ["cotton"], size: { h: 28, w: 35.5, uom: "cm" } } ) // Start Example 1 var document = new BsonDocument @@ -76,10 +77,10 @@ public void Example_2() [Fact] public void Example_3() { - // db.inventory.insertMany([ + // db.inventory.insertMany([ // { item: "journal", qty: 25, tags: ["blank", "red"], size: { h: 14, w: 21, uom: "cm" } }, // { item: "mat", qty: 85, tags: ["gray"], size: { h: 27.9, w: 35.5, uom: "cm" } }, - // { item: "mousepad", qty: 25, tags: ["gel", "blue"], size: { h: 19, w: 22.85, uom: "cm" } } ]) + // { item: "mousepad", qty: 25, tags: ["gel", "blue"], size: { h: 19, w: 22.85, uom: "cm" } } ]) // Start Example 3 var documents = new BsonDocument[] @@ -125,7 +126,7 @@ public void Example_6() // { item: "notebook", qty: 50, size: { h: 8.5, w: 11, uom: "in" }, status: "A" }, // { item: "paper", qty: 100, size: { h: 8.5, w: 11, uom: "in" }, status: "D" }, // { item: "planner", qty: 75, size: { h: 22.85, w: 30, uom: "cm" }, status: "D" }, - // { item: "postcard", qty: 45, size: { h: 10, w: 15.25, uom: "cm" }, status: "A" } ]) + // { item: "postcard", qty: 45, size: { h: 10, w: 15.25, uom: "cm" }, status: "A" } ]) // Start Example 6 var documents = new BsonDocument[] @@ -265,7 +266,7 @@ public void Example_13() [Fact] public void Example_14() { - // db.inventory.insertMany( [ + // db.inventory.insertMany( [ // { item: "journal", qty: 25, size: { h: 14, w: 21, uom: "cm" }, status: "A" }, // { item: "notebook", qty: 50, size: { h: 8.5, w: 11, uom: "in" }, status: "A" }, // { item: "paper", qty: 100, size: { h: 8.5, w: 11, uom: "in" }, status: "D" }, @@ -392,7 +393,7 @@ public void Example_19() [Fact] public void Example_20() { - // db.inventory.insertMany([ + // db.inventory.insertMany([ // { item: "journal", qty: 25, tags: ["blank", "red"], dim_cm: [ 14, 21 ] }, // { item: "notebook", qty: 50, tags: ["red", "blank"], dim_cm: [ 14, 21 ] }, // { item: "paper", qty: 100, tags: ["red", "blank", "plain"], dim_cm: [ 14, 21 ] }, @@ -559,7 +560,7 @@ public void Example_28() [Fact] public void Example_29() { - // db.inventory.insertMany( [ + // db.inventory.insertMany( [ // { item: "journal", instock: [ { warehouse: "A", qty: 5 }, { warehouse: "C", qty: 15 } ] }, // { item: "notebook", instock: [ { warehouse: "C", qty: 5 } ] }, // { item: "paper", instock: [ { warehouse: "A", qty: 60 }, { warehouse: "B", qty: 15 } ] }, @@ -795,7 +796,7 @@ public void Example_41() [Fact] public void Example_42() { - // db.inventory.insertMany( [ + // db.inventory.insertMany( [ // { item: "journal", status: "A", size: { h: 14, w: 21, uom: "cm" }, instock: [ { warehouse: "A", qty: 5 } ] }, // { item: "notebook", status: "A", size: { h: 8.5, w: 11, uom: "in" }, instock: [ { warehouse: "C", qty: 5 } ] }, // { item: "paper", status: "D", size: { h: 8.5, w: 11, uom: "in" }, instock: [ { warehouse: "A", qty: 60 } ] }, @@ -992,7 +993,7 @@ public void Example_50() [Fact] public void Example_51() { - // db.inventory.insertMany( [ + // db.inventory.insertMany( [ // { item: "canvas", qty: 100, size: { h: 28, w: 35.5, uom: "cm" }, status: "A" }, // { item: "journal", qty: 25, size: { h: 14, w: 21, uom: "cm" }, status: "A" }, // { item: "mat", qty: 85, size: { h: 27.9, w: 35.5, uom: "cm" }, status: "A" }, @@ -1002,7 +1003,7 @@ public void Example_51() // { item: "planner", qty: 75, size: { h: 22.85, w: 30, uom: "cm" }, status: "D" }, // { item: "postcard", qty: 45, size: { h: 10, w: 15.25, uom: "cm" }, status: "A" }, // { item: "sketchbook", qty: 80, size: { h: 14, w: 21, uom: "cm" }, status: "A" }, - // { item: "sketch pad", qty: 95, size: { h: 22.85, w: 30.5, uom: "cm" }, status: "A" } ]); + // { item: "sketch pad", qty: 95, size: { h: 22.85, w: 30.5, uom: "cm" }, status: "A" } ]); // Start Example 51 var documents = new[] @@ -1149,12 +1150,12 @@ public void Example_54() [Fact] public void Example_55() { - // db.inventory.insertMany( [ + // db.inventory.insertMany( [ // { item: "journal", qty: 25, size: { h: 14, w: 21, uom: "cm" }, status: "A" }, // { item: "notebook", qty: 50, size: { h: 8.5, w: 11, uom: "in" }, status: "P" }, // { item: "paper", qty: 100, size: { h: 8.5, w: 11, uom: "in" }, status: "D" }, // { item: "planner", qty: 75, size: { h: 22.85, w: 30, uom: "cm" }, status: "D" }, - // { item: "postcard", qty: 45, size: { h: 10, w: 15.25, uom: "cm" }, status: "A" }, ]); + // { item: "postcard", qty: 45, size: { h: 10, w: 15.25, uom: "cm" }, status: "A" }, ]); // Start Example 55 var documents = new[] @@ -1252,7 +1253,7 @@ public void Aggregation_Example_1() { RequireServer.Check(); - //db.sales.aggregate([ + //db.sales.aggregate([ // { $match : { "items.fruit":"banana" } }, // { $sort : { "date" : 1 } } //]) @@ -1347,7 +1348,7 @@ public void Aggregation_Example_3() // } //}, //{ - // $project: { day: "$_id.day", revenue: 1, items_sold: 1, + // $project: { day: "$_id.day", revenue: 1, items_sold: 1, // discount: { $cond: { if : { $lte: ["$revenue", 250] }, then: 25, else : 0 }} // } //}]) @@ -1421,7 +1422,7 @@ public void Aggregation_Example_4() // $project : { // "_id" : 0, // "name" : 1, - // airlines : { + // airlines : { // $filter : { // input : "$airlines", // as : "airline", diff --git a/tests/MongoDB.Driver.Examples/ExplicitEncryptionExamples.cs b/tests/MongoDB.Driver.Examples/ExplicitEncryptionExamples.cs index ae948248240..3676919afae 100644 --- a/tests/MongoDB.Driver.Examples/ExplicitEncryptionExamples.cs +++ b/tests/MongoDB.Driver.Examples/ExplicitEncryptionExamples.cs @@ -25,6 +25,7 @@ namespace MongoDB.Driver.Examples { + [Trait("Category", "Integration")] public class ExplicitEncryptionExamples { private const string LocalMasterKey = "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk"; diff --git a/tests/MongoDB.Driver.Examples/PrimerTestFixture.cs b/tests/MongoDB.Driver.Examples/PrimerTestFixture.cs index e6982eafa17..65288622f30 100644 --- a/tests/MongoDB.Driver.Examples/PrimerTestFixture.cs +++ b/tests/MongoDB.Driver.Examples/PrimerTestFixture.cs @@ -18,9 +18,11 @@ using System.IO; using System.Reflection; using MongoDB.Bson; +using Xunit; namespace MongoDB.Driver.Examples { + [Trait("Category", "Integration")] public abstract class PrimerTestFixture { protected static IMongoClient __client; diff --git a/tests/MongoDB.Driver.Examples/StableApiExamples.cs b/tests/MongoDB.Driver.Examples/StableApiExamples.cs index 56bcb2900e8..8d636aa63e0 100644 --- a/tests/MongoDB.Driver.Examples/StableApiExamples.cs +++ b/tests/MongoDB.Driver.Examples/StableApiExamples.cs @@ -19,6 +19,7 @@ namespace MongoDB.Driver.Examples { + [Trait("Category", "Integration")] public class StableApiExamples { [Fact] diff --git a/tests/MongoDB.Driver.Examples/TransactionExamplesForDocs/WithTransactionExample1.cs b/tests/MongoDB.Driver.Examples/TransactionExamplesForDocs/WithTransactionExample1.cs index 9251a5da4e7..66da76dc1a0 100644 --- a/tests/MongoDB.Driver.Examples/TransactionExamplesForDocs/WithTransactionExample1.cs +++ b/tests/MongoDB.Driver.Examples/TransactionExamplesForDocs/WithTransactionExample1.cs @@ -23,6 +23,7 @@ namespace MongoDB.Driver.Examples.TransactionExamplesForDocs { + [Trait("Category", "Integration")] public class WithTransactionExample1 { [Fact] diff --git a/tests/MongoDB.Driver.TestHelpers/IntegrationTest.cs b/tests/MongoDB.Driver.TestHelpers/IntegrationTest.cs index c0424339d5f..f373a4d897e 100644 --- a/tests/MongoDB.Driver.TestHelpers/IntegrationTest.cs +++ b/tests/MongoDB.Driver.TestHelpers/IntegrationTest.cs @@ -20,7 +20,7 @@ namespace MongoDB.Driver.Tests { - [IntegrationTest] + [Trait("Category", "Integration")] public abstract class IntegrationTest : IClassFixture where TFixture : MongoDatabaseFixture { diff --git a/tests/MongoDB.Driver.TestHelpers/MongoDB.Driver.TestHelpers.csproj b/tests/MongoDB.Driver.TestHelpers/MongoDB.Driver.TestHelpers.csproj index 096fcb8bc0b..e1faee5876f 100644 --- a/tests/MongoDB.Driver.TestHelpers/MongoDB.Driver.TestHelpers.csproj +++ b/tests/MongoDB.Driver.TestHelpers/MongoDB.Driver.TestHelpers.csproj @@ -2,6 +2,7 @@ + false ..\..\MongoDBTest.ruleset diff --git a/tests/MongoDB.Driver.Tests/AggregateFluentFacetTests.cs b/tests/MongoDB.Driver.Tests/AggregateFluentFacetTests.cs index c248cdc75cc..71c13c2577b 100644 --- a/tests/MongoDB.Driver.Tests/AggregateFluentFacetTests.cs +++ b/tests/MongoDB.Driver.Tests/AggregateFluentFacetTests.cs @@ -23,11 +23,11 @@ using MongoDB.Bson.Serialization.Serializers; using MongoDB.Bson.TestHelpers; using MongoDB.Driver.Core.TestHelpers.XunitExtensions; -using MongoDB.Driver.Linq; using Xunit; namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class AggregateFluentFacetTests { #region static diff --git a/tests/MongoDB.Driver.Tests/AggregateFluentGraphLookupWithAirportsCollectionTests.cs b/tests/MongoDB.Driver.Tests/AggregateFluentGraphLookupWithAirportsCollectionTests.cs index 29142383c79..3bccb211750 100644 --- a/tests/MongoDB.Driver.Tests/AggregateFluentGraphLookupWithAirportsCollectionTests.cs +++ b/tests/MongoDB.Driver.Tests/AggregateFluentGraphLookupWithAirportsCollectionTests.cs @@ -26,6 +26,7 @@ namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class AggregateFluentGraphLookupWithAirportCollectionTests { #region static diff --git a/tests/MongoDB.Driver.Tests/AggregateFluentGraphLookupWithEmployeeCollectionTests.cs b/tests/MongoDB.Driver.Tests/AggregateFluentGraphLookupWithEmployeeCollectionTests.cs index f2df2ed9e72..291b675ccc2 100644 --- a/tests/MongoDB.Driver.Tests/AggregateFluentGraphLookupWithEmployeeCollectionTests.cs +++ b/tests/MongoDB.Driver.Tests/AggregateFluentGraphLookupWithEmployeeCollectionTests.cs @@ -27,6 +27,7 @@ namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class AggregateFluentGraphLookupWithEmployeeCollectionTests { #region static diff --git a/tests/MongoDB.Driver.Tests/AggregateFluentTests.cs b/tests/MongoDB.Driver.Tests/AggregateFluentTests.cs index ea4c6c9a3b2..405ec767829 100644 --- a/tests/MongoDB.Driver.Tests/AggregateFluentTests.cs +++ b/tests/MongoDB.Driver.Tests/AggregateFluentTests.cs @@ -31,6 +31,7 @@ namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class AggregateFluentTests { [Theory] diff --git a/tests/MongoDB.Driver.Tests/AggregateGraphLookupEnumerableFromOrToTests.cs b/tests/MongoDB.Driver.Tests/AggregateGraphLookupEnumerableFromOrToTests.cs index fee02d81a62..87c3af7d176 100644 --- a/tests/MongoDB.Driver.Tests/AggregateGraphLookupEnumerableFromOrToTests.cs +++ b/tests/MongoDB.Driver.Tests/AggregateGraphLookupEnumerableFromOrToTests.cs @@ -16,12 +16,12 @@ using System.Collections.Generic; using FluentAssertions; using MongoDB.Bson; -using MongoDB.Driver.Core.Misc; using MongoDB.Driver.Core.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class AggregateGraphLookupEnumerableFromOrToTests { // public methods diff --git a/tests/MongoDB.Driver.Tests/AsyncCursorTests.cs b/tests/MongoDB.Driver.Tests/AsyncCursorTests.cs index e9864e8d1c8..72fe1a39f88 100644 --- a/tests/MongoDB.Driver.Tests/AsyncCursorTests.cs +++ b/tests/MongoDB.Driver.Tests/AsyncCursorTests.cs @@ -30,6 +30,7 @@ namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class AsyncCursorTests { //public methods diff --git a/tests/MongoDB.Driver.Tests/AuthenticationTests.cs b/tests/MongoDB.Driver.Tests/AuthenticationTests.cs index 4e84d4ef060..f60b30c80c5 100644 --- a/tests/MongoDB.Driver.Tests/AuthenticationTests.cs +++ b/tests/MongoDB.Driver.Tests/AuthenticationTests.cs @@ -30,6 +30,7 @@ namespace MongoDB.Driver.Tests /// /// Authentication integration tests. /// + [Trait("Category", "Integration")] public class AuthenticationTests { [Theory] diff --git a/tests/MongoDB.Driver.Tests/CausalConsistencyTests.cs b/tests/MongoDB.Driver.Tests/CausalConsistencyTests.cs index 32d3afdbcf5..c715b00f8e9 100644 --- a/tests/MongoDB.Driver.Tests/CausalConsistencyTests.cs +++ b/tests/MongoDB.Driver.Tests/CausalConsistencyTests.cs @@ -28,6 +28,7 @@ namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class CausalConsistencyTests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/ClientDocumentHelperTests.cs b/tests/MongoDB.Driver.Tests/ClientDocumentHelperTests.cs index 5f714d07ba2..7eaa434a223 100644 --- a/tests/MongoDB.Driver.Tests/ClientDocumentHelperTests.cs +++ b/tests/MongoDB.Driver.Tests/ClientDocumentHelperTests.cs @@ -31,6 +31,7 @@ namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class ClientDocumentHelperTests { private static readonly string __longAString = new string('a', 512); diff --git a/tests/MongoDB.Driver.Tests/ClusterTests.cs b/tests/MongoDB.Driver.Tests/ClusterTests.cs index 97732fc09ee..1852264edc3 100644 --- a/tests/MongoDB.Driver.Tests/ClusterTests.cs +++ b/tests/MongoDB.Driver.Tests/ClusterTests.cs @@ -37,6 +37,7 @@ namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class ClusterTests : LoggableTestClass { private static readonly HashSet __commandsToNotCapture = new HashSet diff --git a/tests/MongoDB.Driver.Tests/ConnectionsSurvivePrimaryStepDownTests.cs b/tests/MongoDB.Driver.Tests/ConnectionsSurvivePrimaryStepDownTests.cs index 5c30e8c1895..f37cd6c4b11 100644 --- a/tests/MongoDB.Driver.Tests/ConnectionsSurvivePrimaryStepDownTests.cs +++ b/tests/MongoDB.Driver.Tests/ConnectionsSurvivePrimaryStepDownTests.cs @@ -31,6 +31,7 @@ namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class ConnectionsSurvivePrimaryStepDownTests { private readonly string _collectionName = "step-down"; diff --git a/tests/MongoDB.Driver.Tests/Core/Bindings/CoreSessionTests.cs b/tests/MongoDB.Driver.Tests/Core/Bindings/CoreSessionTests.cs index 6b3496813e1..4f07e47b740 100644 --- a/tests/MongoDB.Driver.Tests/Core/Bindings/CoreSessionTests.cs +++ b/tests/MongoDB.Driver.Tests/Core/Bindings/CoreSessionTests.cs @@ -224,6 +224,7 @@ public void Dispose_should_have_expected_result( } [Fact] + [Trait("Category", "Integration")] public void StartTransaction_should_throw_when_write_concern_is_unacknowledged() { RequireServer.Check().ClusterType(ClusterType.ReplicaSet).Supports(Feature.Transactions); diff --git a/tests/MongoDB.Driver.Tests/Core/Connections/TcpStreamFactoryTests.cs b/tests/MongoDB.Driver.Tests/Core/Connections/TcpStreamFactoryTests.cs index 014f1b6a523..cfb8f8194c5 100644 --- a/tests/MongoDB.Driver.Tests/Core/Connections/TcpStreamFactoryTests.cs +++ b/tests/MongoDB.Driver.Tests/Core/Connections/TcpStreamFactoryTests.cs @@ -29,6 +29,7 @@ namespace MongoDB.Driver.Core.Connections { + [Trait("Category", "Integration")] public class TcpStreamFactoryTests { [Theory] diff --git a/tests/MongoDB.Driver.Tests/Core/Misc/WireVersionTests.cs b/tests/MongoDB.Driver.Tests/Core/Misc/WireVersionTests.cs index 7c94537bc7b..161b4908c0e 100644 --- a/tests/MongoDB.Driver.Tests/Core/Misc/WireVersionTests.cs +++ b/tests/MongoDB.Driver.Tests/Core/Misc/WireVersionTests.cs @@ -24,6 +24,7 @@ namespace MongoDB.Driver.Core.Tests.Core.Misc public class WireVersionTests { [Fact] + [Trait("Category", "Integration")] public void Server_maxWireVersion_should_be_in_supported_range() { RequireServer.Check().StableServer(stable: true); diff --git a/tests/MongoDB.Driver.Tests/Core/Operations/OperationTestBase.cs b/tests/MongoDB.Driver.Tests/Core/Operations/OperationTestBase.cs index b323f4e7e1a..c90c70c6132 100644 --- a/tests/MongoDB.Driver.Tests/Core/Operations/OperationTestBase.cs +++ b/tests/MongoDB.Driver.Tests/Core/Operations/OperationTestBase.cs @@ -30,6 +30,7 @@ namespace MongoDB.Driver.Core.Operations { + [Trait("Category", "Integration")] public abstract class OperationTestBase : IDisposable { private protected IClusterInternal _cluster; diff --git a/tests/MongoDB.Driver.Tests/Core/Servers/ServerTests.cs b/tests/MongoDB.Driver.Tests/Core/Servers/ServerTests.cs index 6ecc3ac6234..d0c56e46227 100644 --- a/tests/MongoDB.Driver.Tests/Core/Servers/ServerTests.cs +++ b/tests/MongoDB.Driver.Tests/Core/Servers/ServerTests.cs @@ -883,6 +883,7 @@ private Server SetupServer(bool exceptionOnConnectionOpen, bool exceptionOnConne } } + [Trait("Category", "Integration")] public class ServerChannelTests { [Theory] diff --git a/tests/MongoDB.Driver.Tests/CustomServerSelectorTests.cs b/tests/MongoDB.Driver.Tests/CustomServerSelectorTests.cs index def4ac29b96..14eb15bc38c 100644 --- a/tests/MongoDB.Driver.Tests/CustomServerSelectorTests.cs +++ b/tests/MongoDB.Driver.Tests/CustomServerSelectorTests.cs @@ -27,6 +27,7 @@ namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class CustomServerSelectorTests : LoggableTestClass { public CustomServerSelectorTests(ITestOutputHelper output) : base(output) diff --git a/tests/MongoDB.Driver.Tests/Encryption/AutoEncryptionTests.cs b/tests/MongoDB.Driver.Tests/Encryption/AutoEncryptionTests.cs index 546897cbdbc..6caa5998af3 100644 --- a/tests/MongoDB.Driver.Tests/Encryption/AutoEncryptionTests.cs +++ b/tests/MongoDB.Driver.Tests/Encryption/AutoEncryptionTests.cs @@ -32,6 +32,7 @@ namespace MongoDB.Driver.Tests.Encryption { [Trait("Category", "CSFLE")] + [Trait("Category", "Integration")] public class AutoEncryptionTests : LoggableTestClass { #region static diff --git a/tests/MongoDB.Driver.Tests/Encryption/ClientEncryptionTests.cs b/tests/MongoDB.Driver.Tests/Encryption/ClientEncryptionTests.cs index 3cb767016ea..69cb78ed104 100644 --- a/tests/MongoDB.Driver.Tests/Encryption/ClientEncryptionTests.cs +++ b/tests/MongoDB.Driver.Tests/Encryption/ClientEncryptionTests.cs @@ -37,6 +37,7 @@ namespace MongoDB.Driver.Tests.Encryption { [Trait("Category", "CSFLE")] + [Trait("Category", "Integration")] public class ClientEncryptionTests { #region static diff --git a/tests/MongoDB.Driver.Tests/FilterDefinitionBuilderTests.cs b/tests/MongoDB.Driver.Tests/FilterDefinitionBuilderTests.cs index d51e76fd149..1cd36373e43 100644 --- a/tests/MongoDB.Driver.Tests/FilterDefinitionBuilderTests.cs +++ b/tests/MongoDB.Driver.Tests/FilterDefinitionBuilderTests.cs @@ -1140,6 +1140,7 @@ private enum ProductType } } + [Trait("Category", "Integration")] public class FieldDefinitionBuilderUInt32Tests { #region static @@ -1361,6 +1362,7 @@ private class DocumentWithUInt32Field } } + [Trait("Category", "Integration")] public class FieldDefinitionBuilderUInt64Tests { #region static diff --git a/tests/MongoDB.Driver.Tests/FindFluentTests.cs b/tests/MongoDB.Driver.Tests/FindFluentTests.cs index fb70cd6f43c..78faff1ec9b 100644 --- a/tests/MongoDB.Driver.Tests/FindFluentTests.cs +++ b/tests/MongoDB.Driver.Tests/FindFluentTests.cs @@ -303,8 +303,6 @@ public void ToCursor_should_call_collection_Find_with_expected_arguments( [Fact] public void ToString_should_return_the_correct_string() { - RequireServer.Check().Supports(Feature.FindProjectionExpressions); - var subject = CreateSubject(); subject.Filter = new BsonDocument("Age", 20); subject.Options.Collation = new Collation("en_US"); @@ -325,7 +323,7 @@ public void ToString_should_return_the_correct_string() var str = find.ToString(); - var expectedProjection = + var expectedProjection = "{ \"_v\" : { \"$concat\" : [\"$FirstName\", \" \", \"$LastName\"] }, \"_id\" : 0 }"; str.Should().Be( diff --git a/tests/MongoDB.Driver.Tests/GridFS/GridFSBucketTests.cs b/tests/MongoDB.Driver.Tests/GridFS/GridFSBucketTests.cs index 3ead29d9c82..f4e969d1085 100644 --- a/tests/MongoDB.Driver.Tests/GridFS/GridFSBucketTests.cs +++ b/tests/MongoDB.Driver.Tests/GridFS/GridFSBucketTests.cs @@ -327,6 +327,7 @@ public void DownloadToStreamByName_should_throw_when_filename_is_null( [Theory] [ParameterAttributeData] + [Trait("Category", "Integration")] public void Drop_should_drop_the_files_and_chunks_collections( [Values(false, true)] bool async) { @@ -352,6 +353,7 @@ public void Drop_should_drop_the_files_and_chunks_collections( [Theory] [ParameterAttributeData] + [Trait("Category", "Integration")] public void Drop_should_throw_when_a_write_concern_error_occurss( [Values(false, true)] bool async) @@ -629,6 +631,7 @@ public void UploadFromStream_should_throw_when_source_is_null( [Theory] [ParameterAttributeData] + [Trait("Category", "Integration")] public void GridFS_should_work_with_strict_stable_api( [Values(false, true)] bool async) { diff --git a/tests/MongoDB.Driver.Tests/GridFS/GridFSDownloadStreamBaseTests.cs b/tests/MongoDB.Driver.Tests/GridFS/GridFSDownloadStreamBaseTests.cs index 210cf0c8e4c..948abb45c1c 100644 --- a/tests/MongoDB.Driver.Tests/GridFS/GridFSDownloadStreamBaseTests.cs +++ b/tests/MongoDB.Driver.Tests/GridFS/GridFSDownloadStreamBaseTests.cs @@ -146,6 +146,7 @@ public void constructor_should_initialize_instance() [Theory] [ParameterAttributeData] + [Trait("Category", "Integration")] public void CopyTo_should_copy_stream( [Values(0.0, 0.5, 1.0, 1.5, 2.0, 2.5)] double contentSizeMultiple, [Values(null, 128)] int? bufferSize, @@ -219,6 +220,7 @@ public void FileInfo_should_return_expected_result() [Theory] [ParameterAttributeData] + [Trait("Category", "Integration")] public void Flush_should_not_throw( [Values(false, true)] bool async) { diff --git a/tests/MongoDB.Driver.Tests/GridFS/GridFSSeekableDownloadStreamTests.cs b/tests/MongoDB.Driver.Tests/GridFS/GridFSSeekableDownloadStreamTests.cs index a6f336c4f6c..f291adf375e 100644 --- a/tests/MongoDB.Driver.Tests/GridFS/GridFSSeekableDownloadStreamTests.cs +++ b/tests/MongoDB.Driver.Tests/GridFS/GridFSSeekableDownloadStreamTests.cs @@ -94,6 +94,7 @@ public void RetryReads_get_and_set_should_work( [Theory] [ParameterAttributeData] + [Trait("Category", "Integration")] public void Read_should_return_expected_result( [Values(0.0, 0.5, 1.0, 1.5, 2.0, 2.5)] double fileLengthMultiple, [Values(0.0, 0.5)] double positionMultiple, diff --git a/tests/MongoDB.Driver.Tests/GridFS/GridFSUploadStreamTests.cs b/tests/MongoDB.Driver.Tests/GridFS/GridFSUploadStreamTests.cs index 15070c8b0f6..2be46bb999c 100644 --- a/tests/MongoDB.Driver.Tests/GridFS/GridFSUploadStreamTests.cs +++ b/tests/MongoDB.Driver.Tests/GridFS/GridFSUploadStreamTests.cs @@ -27,6 +27,7 @@ namespace MongoDB.Driver.Tests.GridFS { + [Trait("Category", "Integration")] public class GridFSUploadStreamTests { // public methods diff --git a/tests/MongoDB.Driver.Tests/Jira/CSharp2564Tests.cs b/tests/MongoDB.Driver.Tests/Jira/CSharp2564Tests.cs index 86506f44c21..0bfd0b6aefc 100644 --- a/tests/MongoDB.Driver.Tests/Jira/CSharp2564Tests.cs +++ b/tests/MongoDB.Driver.Tests/Jira/CSharp2564Tests.cs @@ -28,6 +28,7 @@ namespace MongoDB.Driver.Tests.Jira { + [Trait("Category", "Integration")] public class CSharp2564Tests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Jira/CSharp2622Tests.cs b/tests/MongoDB.Driver.Tests/Jira/CSharp2622Tests.cs index a87e83779dd..8e759cbe30b 100644 --- a/tests/MongoDB.Driver.Tests/Jira/CSharp2622Tests.cs +++ b/tests/MongoDB.Driver.Tests/Jira/CSharp2622Tests.cs @@ -13,15 +13,14 @@ * limitations under the License. */ -using System; using FluentAssertions; using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; -using MongoDB.Bson.Serialization.Options; using Xunit; namespace MongoDB.Driver.Tests.Jira { + [Trait("Category", "Integration")] public class CSharp2622Tests { // public methods diff --git a/tests/MongoDB.Driver.Tests/Jira/CSharp3188Tests.cs b/tests/MongoDB.Driver.Tests/Jira/CSharp3188Tests.cs index c3395ad3d04..019ca0c425e 100644 --- a/tests/MongoDB.Driver.Tests/Jira/CSharp3188Tests.cs +++ b/tests/MongoDB.Driver.Tests/Jira/CSharp3188Tests.cs @@ -26,6 +26,7 @@ namespace MongoDB.Driver.Tests.Jira { + [Trait("Category", "Integration")] public class CSharp3188Tests { [Theory] diff --git a/tests/MongoDB.Driver.Tests/Jira/CSharp3225Tests.cs b/tests/MongoDB.Driver.Tests/Jira/CSharp3225Tests.cs index 7241343353b..fcf66974e75 100644 --- a/tests/MongoDB.Driver.Tests/Jira/CSharp3225Tests.cs +++ b/tests/MongoDB.Driver.Tests/Jira/CSharp3225Tests.cs @@ -24,6 +24,7 @@ namespace MongoDB.Driver.Tests.Jira { + [Trait("Category", "Integration")] public class CSharp3225Tests { // these examples are taken from: https://www.mongodb.com/docs/manual/reference/operator/aggregation/setWindowFields/#examples diff --git a/tests/MongoDB.Driver.Tests/Jira/CSharp3397Tests.cs b/tests/MongoDB.Driver.Tests/Jira/CSharp3397Tests.cs index 49a24a71359..a7212d38c57 100644 --- a/tests/MongoDB.Driver.Tests/Jira/CSharp3397Tests.cs +++ b/tests/MongoDB.Driver.Tests/Jira/CSharp3397Tests.cs @@ -14,7 +14,6 @@ */ using System; -using System.Linq; using FluentAssertions; using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; @@ -24,6 +23,7 @@ namespace MongoDB.Driver.Tests.Jira { + [Trait("Category", "Integration")] public class CSharp3397Tests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp1486Tests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp1486Tests.cs index efeb0603e23..ba4e874cab2 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp1486Tests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp1486Tests.cs @@ -19,6 +19,7 @@ namespace MongoDB.Driver.Tests.Linq.Linq3Implementation.Jira { + [Trait("Category", "Integration")] public class CSharp1486Tests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp1771Tests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp1771Tests.cs index 4136ece2276..f7accf57861 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp1771Tests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp1771Tests.cs @@ -18,6 +18,7 @@ namespace MongoDB.Driver.Tests.Linq.Linq3Implementation.Jira { + [Trait("Category", "Integration")] public class CSharp1771Tests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2071Tests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2071Tests.cs index 9f2f9bbbb4c..e446c2b1e70 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2071Tests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2071Tests.cs @@ -18,6 +18,7 @@ namespace MongoDB.Driver.Tests.Linq.Linq3Implementation.Jira { + [Trait("Category", "Integration")] public class CSharp2071Tests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2308Tests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2308Tests.cs index 2fe0d21cf63..0aee509d5ea 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2308Tests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2308Tests.cs @@ -21,6 +21,7 @@ namespace MongoDB.Driver.Tests.Linq.Linq3Implementation.Jira { + [Trait("Category", "Integration")] public class CSharp2308Tests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2422Tests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2422Tests.cs index 0f6b5f62fb9..034b955b29a 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2422Tests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2422Tests.cs @@ -21,6 +21,7 @@ namespace MongoDB.Driver.Tests.Linq.Linq3Implementation.Jira { + [Trait("Category", "Integration")] public class CSharp2422Tests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2708Tests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2708Tests.cs index 74e078c217d..304de253976 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2708Tests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2708Tests.cs @@ -14,11 +14,11 @@ */ using System.Linq; -using MongoDB.Driver.Linq; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3Implementation.Jira { + [Trait("Category", "Integration")] public class CSharp2708Tests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2723Tests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2723Tests.cs index ad64d2efd43..63065869144 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2723Tests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp2723Tests.cs @@ -17,11 +17,11 @@ using System.Linq; using FluentAssertions; using MongoDB.Bson; -using MongoDB.Driver.Linq; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3Implementation.Jira { + [Trait("Category", "Integration")] public class CSharp2723Tests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3283Tests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3283Tests.cs index 0439713d106..cc75b83ee78 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3283Tests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3283Tests.cs @@ -23,6 +23,7 @@ namespace MongoDB.Driver.Tests.Linq.Linq3Implementation.Jira { + [Trait("Category", "Integration")] public class CSharp3283Tests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3425Tests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3425Tests.cs index 41f427d01a6..64afec1a437 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3425Tests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3425Tests.cs @@ -18,6 +18,7 @@ namespace MongoDB.Driver.Tests.Linq.Linq3Implementation.Jira { + [Trait("Category", "Integration")] public class CSharp3425Tests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3524Tests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3524Tests.cs index d5dbc8274ba..55db449fe15 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3524Tests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3524Tests.cs @@ -24,6 +24,7 @@ namespace MongoDB.Driver.Tests.Linq.Linq3Implementation.Jira { + [Trait("Category", "Integration")] public class CSharp3524Tests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3630Tests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3630Tests.cs index 2b0f1583f1a..de33370eee2 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3630Tests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3630Tests.cs @@ -18,6 +18,7 @@ namespace MongoDB.Driver.Tests.Linq.Linq3Implementation.Jira { + [Trait("Category", "Integration")] public class CSharp3630Tests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3713Tests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3713Tests.cs index 2673013b576..448a6361063 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3713Tests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3713Tests.cs @@ -19,6 +19,7 @@ namespace MongoDB.Driver.Tests.Linq.Linq3Implementation.Jira { + [Trait("Category", "Integration")] public class CSharp3713Tests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3865Tests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3865Tests.cs index 345b07748ff..9fa2efa1ba8 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3865Tests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3865Tests.cs @@ -14,11 +14,11 @@ */ using System.Linq; -using MongoDB.Driver.Linq; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3Implementation.Jira { + [Trait("Category", "Integration")] public class CSharp3865Tests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3910Tests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3910Tests.cs index 86923f5ae85..691de55fafe 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3910Tests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3910Tests.cs @@ -18,6 +18,7 @@ namespace MongoDB.Driver.Tests.Linq.Linq3Implementation.Jira { + [Trait("Category", "Integration")] public class CSharp3910Tests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3933Tests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3933Tests.cs index 02315b1affc..212ee4a4c1d 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3933Tests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3933Tests.cs @@ -16,11 +16,11 @@ using System.Linq; using MongoDB.Bson; using MongoDB.Bson.Serialization.Serializers; -using MongoDB.Driver.Linq; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3Implementation.Jira { + [Trait("Category", "Integration")] public class CSharp3933Tests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3940Tests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3940Tests.cs index 38bc73edba0..13c1b6456be 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3940Tests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Jira/CSharp3940Tests.cs @@ -19,6 +19,7 @@ namespace MongoDB.Driver.Tests.Linq.Linq3Implementation.Jira { + [Trait("Category", "Integration")] public class CSharp3940Tests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Linq3IntegrationTest.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Linq3IntegrationTest.cs index fd1440ed500..b198cf4e9a1 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Linq3IntegrationTest.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/Linq3IntegrationTest.cs @@ -18,12 +18,13 @@ using FluentAssertions; using MongoDB.Bson; using MongoDB.Bson.Serialization; -using MongoDB.Driver.Linq; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; +using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3Implementation { + [Trait("Category", "Integration")] public abstract class Linq3IntegrationTest { protected void AssertStages(IEnumerable stages, params string[] expectedStages) diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/MongoQueryProviderTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/MongoQueryProviderTests.cs index 98f8f5d2155..65890c4b457 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/MongoQueryProviderTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3Implementation/MongoQueryProviderTests.cs @@ -24,6 +24,7 @@ namespace MongoDB.Driver.Tests.Linq.Linq3Implementation { + [Trait("Category", "Integration")] public class MongoQueryProviderTests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/IntegrationTestBase.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/IntegrationTestBase.cs index e422523ff9d..f6e8c0bd3ad 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/IntegrationTestBase.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/IntegrationTestBase.cs @@ -18,9 +18,11 @@ using System.Collections.Generic; using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; +using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests { + [Trait("Category", "Integration")] public abstract class IntegrationTestBase { protected static IMongoCollection __collection; diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableEnumComparedToEnumTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableEnumComparedToEnumTests.cs index 0020e737169..df5918efdd7 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableEnumComparedToEnumTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableEnumComparedToEnumTests.cs @@ -18,10 +18,12 @@ using MongoDB.Bson; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; +using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests { + [Trait("Category", "Integration")] public class MongoQueryableEnumComparedToEnumTests { private static readonly IMongoClient __client; diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableEnumComparedToEnumWithStringRepresentationTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableEnumComparedToEnumWithStringRepresentationTests.cs index cad6a9933d2..ce56f7e500a 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableEnumComparedToEnumWithStringRepresentationTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableEnumComparedToEnumWithStringRepresentationTests.cs @@ -19,10 +19,12 @@ using MongoDB.Bson.Serialization.Attributes; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; +using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests { + [Trait("Category", "Integration")] public class MongoQueryableEnumComparedToEnumWithStringRepresentationTests { private static readonly IMongoClient __client; diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntArrayComparedToEnumerableIntTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntArrayComparedToEnumerableIntTests.cs index fae8b42b343..71a24a6633a 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntArrayComparedToEnumerableIntTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntArrayComparedToEnumerableIntTests.cs @@ -19,10 +19,12 @@ using MongoDB.Bson; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; +using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests { + [Trait("Category", "Integration")] public class MongoQueryableIntArrayComparedToEnumerableIntTests { private static readonly IMongoClient __client; diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToDoubleTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToDoubleTests.cs index cc9d25626e5..c0b0fa54906 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToDoubleTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToDoubleTests.cs @@ -18,10 +18,12 @@ using MongoDB.Bson; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; +using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests { + [Trait("Category", "Integration")] public class MongoQueryableIntComparedToDoubleTests { private static readonly IMongoClient __client; diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToDoubleWithStringRepresentationTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToDoubleWithStringRepresentationTests.cs index ac02c947b84..39801df0203 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToDoubleWithStringRepresentationTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToDoubleWithStringRepresentationTests.cs @@ -19,10 +19,12 @@ using MongoDB.Bson.Serialization.Attributes; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; +using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests { + [Trait("Category", "Integration")] public class MongoQueryableIntComparedToDoubleWithStringRepresentationTests { private static readonly IMongoClient __client; diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToNullableIntTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToNullableIntTests.cs index 69d9d98ac0f..0421363db92 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToNullableIntTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToNullableIntTests.cs @@ -18,10 +18,12 @@ using MongoDB.Bson; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; +using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests { + [Trait("Category", "Integration")] public class MongoQueryableIntComparedToNullableIntTests { private static readonly IMongoClient __client; diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToNullableIntWithStringRepresentationTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToNullableIntWithStringRepresentationTests.cs index d9367c2df9f..fe24b33a30f 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToNullableIntWithStringRepresentationTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToNullableIntWithStringRepresentationTests.cs @@ -19,10 +19,12 @@ using MongoDB.Bson.Serialization.Attributes; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; +using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests { + [Trait("Category", "Integration")] public class MongoQueryableIntComparedToNullableIntWithStringRepresentationTests { private static readonly IMongoClient __client; diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableNullableEnumComparedToNullableEnumTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableNullableEnumComparedToNullableEnumTests.cs index 0d28da7db01..aead940be88 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableNullableEnumComparedToNullableEnumTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableNullableEnumComparedToNullableEnumTests.cs @@ -18,10 +18,12 @@ using MongoDB.Bson; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; +using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests { + [Trait("Category", "Integration")] public class MongoQueryableNullableEnumComparedToNullableEnumTests { private static readonly IMongoClient __client; diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableNullableEnumComparedToNullableEnumWithStringRepresentationTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableNullableEnumComparedToNullableEnumWithStringRepresentationTests.cs index e8d4310a731..d54e719e597 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableNullableEnumComparedToNullableEnumWithStringRepresentationTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableNullableEnumComparedToNullableEnumWithStringRepresentationTests.cs @@ -19,10 +19,12 @@ using MongoDB.Bson.Serialization.Attributes; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; +using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests { + [Trait("Category", "Integration")] public class MongoQueryableNullableEnumComparedToNullableEnumWithStringRepresentationTests { private static readonly IMongoClient __client; diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableWithDotNotationTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableWithDotNotationTests.cs index 0e4e4af8c0f..7865978cd41 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableWithDotNotationTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableWithDotNotationTests.cs @@ -20,10 +20,12 @@ using MongoDB.Bson; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; +using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests { + [Trait("Category", "Integration")] public class MongoQueryableWithDotNotationTests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/Translators/LegacyPredicateTranslatorTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/Translators/LegacyPredicateTranslatorTests.cs index 361855cc07a..019de4d5ee5 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/Translators/LegacyPredicateTranslatorTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/Translators/LegacyPredicateTranslatorTests.cs @@ -27,10 +27,12 @@ using MongoDB.Driver.Linq.Linq3Implementation.Misc; using MongoDB.Driver.Linq.Linq3Implementation.Translators; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToFilterTranslators; +using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests.Translators { + [Trait("Category", "Integration")] public class LegacyPredicateTranslatorTests { private static IMongoDatabase __database; diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/Translators/PredicateTranslatorValidationTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/Translators/PredicateTranslatorValidationTests.cs index 7bdb46a2219..49a49a6c212 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/Translators/PredicateTranslatorValidationTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/Translators/PredicateTranslatorValidationTests.cs @@ -19,13 +19,14 @@ using System.Linq.Expressions; using FluentAssertions; using MongoDB.Bson; -using MongoDB.Driver; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; -using Xunit; + +using MongoDB.TestHelpers.XunitExtensions;using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests.Translators { + [Trait("Category", "Integration")] public class PredicateTranslatorValidationTests { private IMongoCollection _collection; diff --git a/tests/MongoDB.Driver.Tests/ListDatabasesTests.cs b/tests/MongoDB.Driver.Tests/ListDatabasesTests.cs index 9840f441ec0..c5bf7d955a1 100644 --- a/tests/MongoDB.Driver.Tests/ListDatabasesTests.cs +++ b/tests/MongoDB.Driver.Tests/ListDatabasesTests.cs @@ -23,6 +23,7 @@ namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class ListDatabasesTests { private string _databaseName = $"authorizedDatabases{Guid.NewGuid()}"; diff --git a/tests/MongoDB.Driver.Tests/LoggingTests.cs b/tests/MongoDB.Driver.Tests/LoggingTests.cs index 04f83dbca0e..118d2404f98 100644 --- a/tests/MongoDB.Driver.Tests/LoggingTests.cs +++ b/tests/MongoDB.Driver.Tests/LoggingTests.cs @@ -21,12 +21,12 @@ using MongoDB.Driver.Core.Configuration; using MongoDB.Driver.Core.Logging; using MongoDB.Driver.Core.TestHelpers.Logging; -using MongoDB.Driver.Linq; using Xunit; using Xunit.Abstractions; namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class LoggingTests : LoggableTestClass { public LoggingTests(ITestOutputHelper output) : base(output, includeAllCategories: true) @@ -102,7 +102,7 @@ public void Prose_tests_truncation_limit_1(int? maxDocumentSize) : new LoggingSettings(LoggerFactory, maxDocumentSize.Value); using (var client = DriverTestConfiguration.CreateMongoClient(loggingSettings)) { - + var db = client.GetDatabase(DriverTestConfiguration.DatabaseNamespace.DatabaseName); try diff --git a/tests/MongoDB.Driver.Tests/MongoClientSettingsTests.cs b/tests/MongoDB.Driver.Tests/MongoClientSettingsTests.cs index ddcffdadf19..6c188b5c6a4 100644 --- a/tests/MongoDB.Driver.Tests/MongoClientSettingsTests.cs +++ b/tests/MongoDB.Driver.Tests/MongoClientSettingsTests.cs @@ -1110,6 +1110,7 @@ public void TestServersWithSrvMaxHosts() } [Fact] + [Trait("Category", "Integration")] public void TestSocketConfigurator() { RequireServer.Check(); diff --git a/tests/MongoDB.Driver.Tests/MongoClientTests.cs b/tests/MongoDB.Driver.Tests/MongoClientTests.cs index d1f06516a2f..36d6bca9231 100644 --- a/tests/MongoDB.Driver.Tests/MongoClientTests.cs +++ b/tests/MongoDB.Driver.Tests/MongoClientTests.cs @@ -28,6 +28,7 @@ namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class MongoClientTests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/MongoCollectionImplTests.cs b/tests/MongoDB.Driver.Tests/MongoCollectionImplTests.cs index 818c29ade41..d89660af55e 100644 --- a/tests/MongoDB.Driver.Tests/MongoCollectionImplTests.cs +++ b/tests/MongoDB.Driver.Tests/MongoCollectionImplTests.cs @@ -3805,6 +3805,7 @@ public void Watch_should_throw_when_pipeline_is_null( } [Fact] + [Trait("Category", "Integration")] public void Watch_should_support_full_document_with_duplicate_elements() { RequireServer.Check().ClusterTypes(ClusterType.ReplicaSet, ClusterType.Sharded); diff --git a/tests/MongoDB.Driver.Tests/MongoCredentialTests.cs b/tests/MongoDB.Driver.Tests/MongoCredentialTests.cs index 8b1c38ee667..e44f90e0cdc 100644 --- a/tests/MongoDB.Driver.Tests/MongoCredentialTests.cs +++ b/tests/MongoDB.Driver.Tests/MongoCredentialTests.cs @@ -20,6 +20,7 @@ namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class MongoCredentialTests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/MongoDatabasTests.cs b/tests/MongoDB.Driver.Tests/MongoDatabasTests.cs index 9b35886d6b9..68cb5526beb 100644 --- a/tests/MongoDB.Driver.Tests/MongoDatabasTests.cs +++ b/tests/MongoDB.Driver.Tests/MongoDatabasTests.cs @@ -380,6 +380,7 @@ public void AggregateToCollection_should_throw_when_last_stage_is_not_an_output_ [Theory] [ParameterAttributeData] + [Trait("Category", "Integration")] public void CreateCollection_should_execute_a_CreateCollectionOperation_when_options_is_generic( [Values(false, true)] bool usingSession, [Values(false, true)] bool clustered, @@ -881,6 +882,7 @@ public void ListCollectionNames_should_execute_a_ListCollectionsOperation( [Theory] [ParameterAttributeData] + [Trait("Category", "Integration")] public void ListCollectionNames_should_return_expected_result( [Values(0, 1, 2, 10)] int numberOfCollections, [Values(null, false, true)] bool? usingAuthorizedCollections, diff --git a/tests/MongoDB.Driver.Tests/MongoIndexManagerTests.cs b/tests/MongoDB.Driver.Tests/MongoIndexManagerTests.cs index ac5fbef4289..1c0228246a1 100644 --- a/tests/MongoDB.Driver.Tests/MongoIndexManagerTests.cs +++ b/tests/MongoDB.Driver.Tests/MongoIndexManagerTests.cs @@ -22,6 +22,7 @@ namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class MongoIndexManagerTests { [Theory] diff --git a/tests/MongoDB.Driver.Tests/OfTypeMongoCollectionTests.cs b/tests/MongoDB.Driver.Tests/OfTypeMongoCollectionTests.cs index 04de648d449..a1adc1f8713 100644 --- a/tests/MongoDB.Driver.Tests/OfTypeMongoCollectionTests.cs +++ b/tests/MongoDB.Driver.Tests/OfTypeMongoCollectionTests.cs @@ -954,6 +954,7 @@ public class UpdateTestCases : IValueGenerator } } + [Trait("Category", "Integration")] public class OfTypeCollectionIntegrationTests : IDisposable { private readonly IMongoCollection _docsCollection; diff --git a/tests/MongoDB.Driver.Tests/PinnedShardRouterTests.cs b/tests/MongoDB.Driver.Tests/PinnedShardRouterTests.cs index 7f13da6299a..0bc0f122ebc 100644 --- a/tests/MongoDB.Driver.Tests/PinnedShardRouterTests.cs +++ b/tests/MongoDB.Driver.Tests/PinnedShardRouterTests.cs @@ -26,12 +26,12 @@ using MongoDB.Driver.Core.Servers; using MongoDB.Driver.Core.TestHelpers.Logging; using MongoDB.Driver.Core.TestHelpers.XunitExtensions; -using MongoDB.Driver.TestHelpers; using Xunit; using Xunit.Abstractions; namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class PinnedShardRouterTests : LoggableTestClass { private static readonly HashSet __commandsToNotCapture = new HashSet diff --git a/tests/MongoDB.Driver.Tests/PipelineDefinitionBuilderTests.cs b/tests/MongoDB.Driver.Tests/PipelineDefinitionBuilderTests.cs index 3c556553c7d..0c64431d746 100644 --- a/tests/MongoDB.Driver.Tests/PipelineDefinitionBuilderTests.cs +++ b/tests/MongoDB.Driver.Tests/PipelineDefinitionBuilderTests.cs @@ -181,6 +181,7 @@ public void Lookup_should_throw_when_pipeline_is_null() } [Fact] + [Trait("Category", "Integration")] public void Merge_should_add_expected_stage() { var pipeline = new EmptyPipelineDefinition(); @@ -233,15 +234,15 @@ public void RankFusion_with_named_pipelines_should_add_expected_stage() stages.Count.Should().Be(1); stages[0].Should().Be(""" { - $rankFusion: { - "input" : { - "pipelines" : { + $rankFusion: { + "input" : { + "pipelines" : { "p1" : [{ "$match" : { "x" : 1 } }, { "$sort" : { "y" : 1 } }], - "p2" : [{ "$match" : { "x" : 2 } }, { "$sort" : { "y" : -1 } }] - } + "p2" : [{ "$match" : { "x" : 2 } }, { "$sort" : { "y" : -1 } }] + } }, "combination" : { "weights" : { "p1" : 0.3, "p2" : 0.7 } } - "scoreDetails" : true + "scoreDetails" : true } } """); @@ -260,12 +261,12 @@ public void RankFusion_without_named_pipelines_should_add_expected_stage() stages.Count.Should().Be(1); stages[0].Should().Be(""" { - $rankFusion: { - "input" : { - "pipelines" : { + $rankFusion: { + "input" : { + "pipelines" : { "pipeline1" : [{ "$match" : { "x" : 1 } }, { "$sort" : { "y" : 1 } }], - "pipeline2" : [{ "$match" : { "x" : 2 } }, { "$sort" : { "y" : -1 } }] - } + "pipeline2" : [{ "$match" : { "x" : 2 } }, { "$sort" : { "y" : -1 } }] + } } } } @@ -286,13 +287,13 @@ public void RankFusion_using_pipeline_weight_tuples_should_add_expected_stage() stages.Count.Should().Be(1); stages[0].Should().Be(""" { - $rankFusion: { - "input" : { - "pipelines" : { + $rankFusion: { + "input" : { + "pipelines" : { "pipeline1" : [{ "$match" : { "x" : 1 } }, { "$sort" : { "y" : 1 } }], - "pipeline2" : [{ "$match" : { "x" : 2 } }, { "$sort" : { "y" : -1 } }], - "pipeline3" : [{ "$match" : { "x" : 3 } }, { "$sort" : { "y" : 1 } }] - } + "pipeline2" : [{ "$match" : { "x" : 2 } }, { "$sort" : { "y" : -1 } }], + "pipeline3" : [{ "$match" : { "x" : 3 } }, { "$sort" : { "y" : 1 } }] + } }, "combination" : { "weights" : { "pipeline1" : 0.3, "pipeline2" : 0.7 } } } diff --git a/tests/MongoDB.Driver.Tests/PipelineStageDefinitionBuilderTests.cs b/tests/MongoDB.Driver.Tests/PipelineStageDefinitionBuilderTests.cs index d78985a8932..9cf990a7741 100644 --- a/tests/MongoDB.Driver.Tests/PipelineStageDefinitionBuilderTests.cs +++ b/tests/MongoDB.Driver.Tests/PipelineStageDefinitionBuilderTests.cs @@ -27,6 +27,7 @@ namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class PipelineStageDefinitionBuilderTests { // public methods @@ -150,15 +151,15 @@ public void GeoNear_with_array_should_return_the_expected_result() var stage = RenderStage(result); stage.Document.Should().Be(""" - { - "$geoNear" : { - "near" : [34.0, 67.0], - "distanceField" : "calculatedDistance", - "maxDistance" : 3.0, - "query" : { "testfield" : "testvalue" }, - "includeLocs" : "usedLocation", - "spherical" : true - } + { + "$geoNear" : { + "near" : [34.0, 67.0], + "distanceField" : "calculatedDistance", + "maxDistance" : 3.0, + "query" : { "testfield" : "testvalue" }, + "includeLocs" : "usedLocation", + "spherical" : true + } } """); } @@ -179,15 +180,15 @@ public void GeoNear_with_geojson_point_should_return_the_expected_result() var stage = RenderStage(result); stage.Document.Should().Be(""" - { - "$geoNear" : { - "near" : { "type" : "Point", "coordinates" : [34.0, 67.0] }, - "distanceField" : "calculatedDistance", - "maxDistance" : 3.0, - "query" : { "testfield" : "testvalue" }, - "includeLocs" : "usedLocation", - "spherical" : true - } + { + "$geoNear" : { + "near" : { "type" : "Point", "coordinates" : [34.0, 67.0] }, + "distanceField" : "calculatedDistance", + "maxDistance" : 3.0, + "query" : { "testfield" : "testvalue" }, + "includeLocs" : "usedLocation", + "spherical" : true + } } """); } @@ -389,6 +390,8 @@ public void Lookup_without_optional_let_should_return_the_expected_result() [InlineData("database2", "collection2", "{ $merge : { into : { db : 'database2', coll : 'collection2' } } }")] public void Merge_with_default_options_should_return_the_expected_result(string outputDatabaseName, string outputCollectionName, string expectedStage) { + RequireServer.Check(); + var client = DriverTestConfiguration.Client; var outputDatabase = client.GetDatabase(outputDatabaseName); var outputCollection = outputDatabase.GetCollection(outputCollectionName); @@ -406,6 +409,8 @@ public void Merge_with_default_options_should_return_the_expected_result(string [InlineData("{ a : 1, b : 2 }", "{ $merge : { into : { db : 'database', coll : 'collection' }, let : { a : 1, b : 2 }, whenMatched : [{ $project : { _id : '$_id' } }] } }")] public void Merge_with_LetVariables_should_return_the_expected_result(string letVariables, string expectedStage) { + RequireServer.Check(); + var client = DriverTestConfiguration.Client; var outputDatabase = client.GetDatabase("database"); var outputCollection = outputDatabase.GetCollection("collection"); @@ -427,6 +432,8 @@ public void Merge_with_LetVariables_should_return_the_expected_result(string let [InlineData("a,b", "{ $merge : { into : { db : 'database', coll : 'collection' }, on : ['a', 'b'] } }")] public void Merge_with_OnFieldNames_should_return_the_expected_result(string fieldNames, string expectedStage) { + RequireServer.Check(); + var client = DriverTestConfiguration.Client; var outputDatabase = client.GetDatabase("database"); var outputCollection = outputDatabase.GetCollection("collection"); @@ -446,6 +453,8 @@ public void Merge_with_OnFieldNames_should_return_the_expected_result(string fie [InlineData(MergeStageWhenMatched.Replace, "{ $merge : { into : { db : 'database', coll : 'collection' }, whenMatched : 'replace' } }")] public void Merge_with_WhenMatched_should_return_the_expected_result(MergeStageWhenMatched whenMatched, string expectedStage) { + RequireServer.Check(); + var client = DriverTestConfiguration.Client; var outputDatabase = client.GetDatabase("database"); var outputCollection = outputDatabase.GetCollection("collection"); @@ -467,6 +476,8 @@ public void Merge_with_WhenMatched_should_return_the_expected_result(MergeStageW [InlineData(MergeStageWhenNotMatched.Insert, "{ $merge : { into : { db : 'database', coll : 'collection' }, whenNotMatched : 'insert' } }")] public void Merge_with_WhenNotMatched_should_return_the_expected_result(MergeStageWhenNotMatched whenNotMatched, string expectedStage) { + RequireServer.Check(); + var client = DriverTestConfiguration.Client; var outputDatabase = client.GetDatabase("database"); var outputCollection = outputDatabase.GetCollection("collection"); diff --git a/tests/MongoDB.Driver.Tests/ReadPreferenceOnStandaloneTests.cs b/tests/MongoDB.Driver.Tests/ReadPreferenceOnStandaloneTests.cs index 63231820663..fb507d13c37 100644 --- a/tests/MongoDB.Driver.Tests/ReadPreferenceOnStandaloneTests.cs +++ b/tests/MongoDB.Driver.Tests/ReadPreferenceOnStandaloneTests.cs @@ -29,6 +29,7 @@ namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class ReadPreferenceOnStandaloneTests : LoggableTestClass { public ReadPreferenceOnStandaloneTests(ITestOutputHelper output) : base(output) diff --git a/tests/MongoDB.Driver.Tests/RetryableWritesTests.cs b/tests/MongoDB.Driver.Tests/RetryableWritesTests.cs index 6f2fc4bad44..58fdbdfa2c3 100644 --- a/tests/MongoDB.Driver.Tests/RetryableWritesTests.cs +++ b/tests/MongoDB.Driver.Tests/RetryableWritesTests.cs @@ -30,6 +30,7 @@ namespace MongoDB.Driver.Tests { + [Trait("Category", "Integration")] public class RetryableWritesTests : LoggableTestClass { // public constructors diff --git a/tests/MongoDB.Driver.Tests/Samples/AggregationSample.cs b/tests/MongoDB.Driver.Tests/Samples/AggregationSample.cs index ed26da058fe..54dc53dfc90 100644 --- a/tests/MongoDB.Driver.Tests/Samples/AggregationSample.cs +++ b/tests/MongoDB.Driver.Tests/Samples/AggregationSample.cs @@ -23,6 +23,7 @@ namespace MongoDB.Driver.Tests.Samples { + [Trait("Category", "Integration")] public class AggregationSample { private static IMongoCollection __collection; diff --git a/tests/MongoDB.Driver.Tests/Search/MongoQueryableTests.cs b/tests/MongoDB.Driver.Tests/Search/MongoQueryableTests.cs index 3597958e860..64ef9a47bed 100644 --- a/tests/MongoDB.Driver.Tests/Search/MongoQueryableTests.cs +++ b/tests/MongoDB.Driver.Tests/Search/MongoQueryableTests.cs @@ -22,6 +22,7 @@ namespace MongoDB.Driver.Tests.Search { + [Trait("Category", "Integration")] public class MongoQueryableTests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Search/VectorSearchTests.cs b/tests/MongoDB.Driver.Tests/Search/VectorSearchTests.cs index d39679f25b6..358d928d0bf 100644 --- a/tests/MongoDB.Driver.Tests/Search/VectorSearchTests.cs +++ b/tests/MongoDB.Driver.Tests/Search/VectorSearchTests.cs @@ -28,6 +28,7 @@ namespace MongoDB.Driver.Tests.Search { [Trait("Category", "AtlasSearch")] + [Trait("Category", "Integration")] public class VectorSearchTests : LoggableTestClass { private readonly IMongoClient _mongoClient; diff --git a/tests/MongoDB.Driver.Tests/Specifications/UnifiedTestSpecRunner.cs b/tests/MongoDB.Driver.Tests/Specifications/UnifiedTestSpecRunner.cs index fe8d7683961..17e9f36d60f 100644 --- a/tests/MongoDB.Driver.Tests/Specifications/UnifiedTestSpecRunner.cs +++ b/tests/MongoDB.Driver.Tests/Specifications/UnifiedTestSpecRunner.cs @@ -32,6 +32,7 @@ namespace MongoDB.Driver.Tests.Specifications { + [Trait("Category", "Integration")] public class UnifiedTestSpecRunner : LoggableTestClass { public UnifiedTestSpecRunner(ITestOutputHelper testOutputHelper) diff --git a/tests/MongoDB.Driver.Tests/Specifications/change-streams/prose-tests/ChangeStreamProseTests.cs b/tests/MongoDB.Driver.Tests/Specifications/change-streams/prose-tests/ChangeStreamProseTests.cs index dcbfbc82cfe..69beb58fa4f 100644 --- a/tests/MongoDB.Driver.Tests/Specifications/change-streams/prose-tests/ChangeStreamProseTests.cs +++ b/tests/MongoDB.Driver.Tests/Specifications/change-streams/prose-tests/ChangeStreamProseTests.cs @@ -25,6 +25,7 @@ namespace MongoDB.Driver.Tests.Specifications.change_streams.prose_tests { + [Trait("Category", "Integration")] public class ChangeStreamProseTests : LoggableTestClass { public ChangeStreamProseTests(ITestOutputHelper testOutputHelper) diff --git a/tests/MongoDB.Driver.Tests/Specifications/client-side-encryption/ClientSideEncryptionTestRunner.cs b/tests/MongoDB.Driver.Tests/Specifications/client-side-encryption/ClientSideEncryptionTestRunner.cs index 29cf6333a79..e4304e3d494 100644 --- a/tests/MongoDB.Driver.Tests/Specifications/client-side-encryption/ClientSideEncryptionTestRunner.cs +++ b/tests/MongoDB.Driver.Tests/Specifications/client-side-encryption/ClientSideEncryptionTestRunner.cs @@ -29,6 +29,7 @@ namespace MongoDB.Driver.Tests.Specifications.client_side_encryption { [Trait("Category", "CSFLE")] [Trait("Category", "Serverless")] + [Trait("Category", "Integration")] public class ClientSideEncryptionTestRunner : MongoClientJsonDrivenTestRunnerBase { #region static diff --git a/tests/MongoDB.Driver.Tests/Specifications/client-side-encryption/prose-tests/ClientEncryptionProseTests.cs b/tests/MongoDB.Driver.Tests/Specifications/client-side-encryption/prose-tests/ClientEncryptionProseTests.cs index f050c834cca..ceafb5aeae4 100644 --- a/tests/MongoDB.Driver.Tests/Specifications/client-side-encryption/prose-tests/ClientEncryptionProseTests.cs +++ b/tests/MongoDB.Driver.Tests/Specifications/client-side-encryption/prose-tests/ClientEncryptionProseTests.cs @@ -55,6 +55,7 @@ namespace MongoDB.Driver.Tests.Specifications.client_side_encryption.prose_tests { [Trait("Category", "CSFLE")] + [Trait("Category", "Integration")] public class ClientEncryptionProseTests : LoggableTestClass { #region static diff --git a/tests/MongoDB.Driver.Tests/Specifications/connection-monitoring-and-pooling/ConnectionMonitoringAndPoolingTestRunner.cs b/tests/MongoDB.Driver.Tests/Specifications/connection-monitoring-and-pooling/ConnectionMonitoringAndPoolingTestRunner.cs index f7b1b28c512..626ef59450a 100644 --- a/tests/MongoDB.Driver.Tests/Specifications/connection-monitoring-and-pooling/ConnectionMonitoringAndPoolingTestRunner.cs +++ b/tests/MongoDB.Driver.Tests/Specifications/connection-monitoring-and-pooling/ConnectionMonitoringAndPoolingTestRunner.cs @@ -44,6 +44,7 @@ namespace MongoDB.Driver.Tests.Specifications.connection_monitoring_and_pooling { [Trait("Category", "Pool")] + [Trait("Category", "Integration")] public class ConnectionMonitoringAndPoolingTestRunner { #region static diff --git a/tests/MongoDB.Driver.Tests/Specifications/crud/CrudTestRunner.cs b/tests/MongoDB.Driver.Tests/Specifications/crud/CrudTestRunner.cs index acdf4c75f80..5659538735d 100644 --- a/tests/MongoDB.Driver.Tests/Specifications/crud/CrudTestRunner.cs +++ b/tests/MongoDB.Driver.Tests/Specifications/crud/CrudTestRunner.cs @@ -32,6 +32,7 @@ namespace MongoDB.Driver.Tests.Specifications.crud { [Trait("Category", "Serverless")] + [Trait("Category", "Integration")] public class CrudTestRunner : LoggableTestClass { #region static diff --git a/tests/MongoDB.Driver.Tests/Specifications/crud/prose-tests/CrudProseTests.cs b/tests/MongoDB.Driver.Tests/Specifications/crud/prose-tests/CrudProseTests.cs index 41987fcfc3e..94902ab9839 100644 --- a/tests/MongoDB.Driver.Tests/Specifications/crud/prose-tests/CrudProseTests.cs +++ b/tests/MongoDB.Driver.Tests/Specifications/crud/prose-tests/CrudProseTests.cs @@ -34,6 +34,7 @@ namespace MongoDB.Driver.Tests.Specifications.crud.prose_tests { [Trait("Category", "Serverless")] + [Trait("Category", "Integration")] public class CrudProseTests : LoggableTestClass { // public constructors diff --git a/tests/MongoDB.Driver.Tests/Specifications/initial-dns-seedlist-discovery/InitialDnsSeedlistDiscoveryTestRunner.cs b/tests/MongoDB.Driver.Tests/Specifications/initial-dns-seedlist-discovery/InitialDnsSeedlistDiscoveryTestRunner.cs index f5e2fdac6d5..64f8b1d7482 100644 --- a/tests/MongoDB.Driver.Tests/Specifications/initial-dns-seedlist-discovery/InitialDnsSeedlistDiscoveryTestRunner.cs +++ b/tests/MongoDB.Driver.Tests/Specifications/initial-dns-seedlist-discovery/InitialDnsSeedlistDiscoveryTestRunner.cs @@ -32,6 +32,7 @@ namespace MongoDB.Driver.Tests.Specifications.initial_dns_seedlist_discovery { [Trait("Category", "ConnectionString")] [Trait("Category", "SupportLoadBalancing")] + [Trait("Category", "Integration")] public class InitialDnsSeedlistDiscoveryTestRunner { [Theory] diff --git a/tests/MongoDB.Driver.Tests/Specifications/retryable-reads/RetryableReadsProseTests.cs b/tests/MongoDB.Driver.Tests/Specifications/retryable-reads/RetryableReadsProseTests.cs index 9738aab1c95..f4aa9cc83ac 100644 --- a/tests/MongoDB.Driver.Tests/Specifications/retryable-reads/RetryableReadsProseTests.cs +++ b/tests/MongoDB.Driver.Tests/Specifications/retryable-reads/RetryableReadsProseTests.cs @@ -33,6 +33,7 @@ namespace MongoDB.Driver.Tests.Specifications.retryable_reads { + [Trait("Category", "Integration")] public class RetryableReadsProseTests { [Theory] diff --git a/tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/MMapV1Tests.cs b/tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/MMapV1Tests.cs index daf40a50152..3e25789963d 100644 --- a/tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/MMapV1Tests.cs +++ b/tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/MMapV1Tests.cs @@ -25,6 +25,7 @@ namespace MongoDB.Driver.Tests.Specifications.retryable_writes.prose_tests { + [Trait("Category", "Integration")] public class MMapV1Tests : LoggableTestClass { public MMapV1Tests(ITestOutputHelper output) : base(output) diff --git a/tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/PoolClearRetryability.cs b/tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/PoolClearRetryability.cs index b3dca6097a8..9054e532708 100644 --- a/tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/PoolClearRetryability.cs +++ b/tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/PoolClearRetryability.cs @@ -34,6 +34,7 @@ namespace MongoDB.Driver.Tests.Specifications.retryable_writes.prose_tests { + [Trait("Category", "Integration")] public class PoolClearRetryability { [Theory] diff --git a/tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/RetryWriteOnOtherMongos.cs b/tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/RetryWriteOnOtherMongos.cs index 9fcb7357c4c..b7d55d58ecf 100644 --- a/tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/RetryWriteOnOtherMongos.cs +++ b/tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/RetryWriteOnOtherMongos.cs @@ -28,6 +28,8 @@ namespace MongoDB.Driver.Tests.Specifications.retryable_writes.prose_tests { + [Trait("Category", "Integration")] + public class RetryWriteOnOtherMongos { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Specifications/server-discovery-and-monitoring/ServerDiscoveryAndMonitoringProseTests.cs b/tests/MongoDB.Driver.Tests/Specifications/server-discovery-and-monitoring/ServerDiscoveryAndMonitoringProseTests.cs index 2d9d3251d7b..c95e14ee7c5 100644 --- a/tests/MongoDB.Driver.Tests/Specifications/server-discovery-and-monitoring/ServerDiscoveryAndMonitoringProseTests.cs +++ b/tests/MongoDB.Driver.Tests/Specifications/server-discovery-and-monitoring/ServerDiscoveryAndMonitoringProseTests.cs @@ -32,13 +32,13 @@ using MongoDB.Driver.Core.Servers; using MongoDB.Driver.Core.TestHelpers; using MongoDB.Driver.Core.TestHelpers.XunitExtensions; -using MongoDB.Driver.TestHelpers; using Moq; using Xunit; namespace MongoDB.Driver.Tests.Specifications.server_discovery_and_monitoring { [Trait("Category", "SDAM")] + [Trait("Category", "Integration")] public class ServerDiscoveryAndMonitoringProseTests { [Fact] diff --git a/tests/MongoDB.Driver.Tests/Specifications/server-discovery-and-monitoring/prose-tests/ServerDiscoveryProseTests.cs b/tests/MongoDB.Driver.Tests/Specifications/server-discovery-and-monitoring/prose-tests/ServerDiscoveryProseTests.cs index 38fbadcce4c..928823a8570 100644 --- a/tests/MongoDB.Driver.Tests/Specifications/server-discovery-and-monitoring/prose-tests/ServerDiscoveryProseTests.cs +++ b/tests/MongoDB.Driver.Tests/Specifications/server-discovery-and-monitoring/prose-tests/ServerDiscoveryProseTests.cs @@ -30,6 +30,7 @@ namespace MongoDB.Driver.Tests.Specifications.server_discovery_and_monitoring.prose_tests { + [Trait("Category", "Integration")] public class ServerDiscoveryProseTests : LoggableTestClass { // public constructors diff --git a/tests/MongoDB.Driver.Tests/Specifications/sessions/SessionsProseTests.cs b/tests/MongoDB.Driver.Tests/Specifications/sessions/SessionsProseTests.cs index a576e48ab48..a2f6f05f091 100644 --- a/tests/MongoDB.Driver.Tests/Specifications/sessions/SessionsProseTests.cs +++ b/tests/MongoDB.Driver.Tests/Specifications/sessions/SessionsProseTests.cs @@ -34,6 +34,7 @@ namespace MongoDB.Driver.Tests.Specifications.sessions { [Trait("Category", "Serverless")] + [Trait("Category", "Integration")] public class SessionsProseTests : LoggableTestClass { public SessionsProseTests(ITestOutputHelper output) : base(output) diff --git a/tests/MongoDB.Driver.Tests/Specifications/uuid/prose-tests/ImplicitEncodingTests.cs b/tests/MongoDB.Driver.Tests/Specifications/uuid/prose-tests/ImplicitEncodingTests.cs index 5a13163a1f3..c3945fa0fdf 100644 --- a/tests/MongoDB.Driver.Tests/Specifications/uuid/prose-tests/ImplicitEncodingTests.cs +++ b/tests/MongoDB.Driver.Tests/Specifications/uuid/prose-tests/ImplicitEncodingTests.cs @@ -22,6 +22,7 @@ namespace MongoDB.Driver.Tests.Specifications.uuid.prose_tests { + [Trait("Category", "Integration")] public class ImplicitEncodingTests { [Fact] diff --git a/tests/MongoDB.TestHelpers/MongoDB.TestHelpers.csproj b/tests/MongoDB.TestHelpers/MongoDB.TestHelpers.csproj index 9c2d724e529..f26db14e0fb 100644 --- a/tests/MongoDB.TestHelpers/MongoDB.TestHelpers.csproj +++ b/tests/MongoDB.TestHelpers/MongoDB.TestHelpers.csproj @@ -2,6 +2,7 @@ + false ..\..\MongoDBLegacyTest.ruleset diff --git a/tests/MongoDB.TestHelpers/XunitExtensions/IntegrationTestAttribute.cs b/tests/MongoDB.TestHelpers/XunitExtensions/IntegrationTestAttribute.cs deleted file mode 100644 index 06b49d22336..00000000000 --- a/tests/MongoDB.TestHelpers/XunitExtensions/IntegrationTestAttribute.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright 2010-present MongoDB Inc. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -namespace MongoDB.TestHelpers.XunitExtensions -{ - public sealed class IntegrationTestAttribute : CategoryAttribute - { - public IntegrationTestAttribute() - : base("Integration") - { - } - } -} diff --git a/tests/SmokeTests/MongoDB.Driver.SmokeTests.Sdk/LibmongocryptTests.cs b/tests/SmokeTests/MongoDB.Driver.SmokeTests.Sdk/LibmongocryptTests.cs index 627a5ea99d7..1ff18a30050 100644 --- a/tests/SmokeTests/MongoDB.Driver.SmokeTests.Sdk/LibmongocryptTests.cs +++ b/tests/SmokeTests/MongoDB.Driver.SmokeTests.Sdk/LibmongocryptTests.cs @@ -25,6 +25,7 @@ namespace MongoDB.Driver.SmokeTests.Sdk { + [Trait("Category", "Integration")] public class LibmongocryptTests { private const string LocalMasterKey = "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk"; diff --git a/tests/SmokeTests/MongoDB.Driver.SmokeTests.Sdk/LoggingTests.cs b/tests/SmokeTests/MongoDB.Driver.SmokeTests.Sdk/LoggingTests.cs index a51cfd21a6e..21e78fea664 100644 --- a/tests/SmokeTests/MongoDB.Driver.SmokeTests.Sdk/LoggingTests.cs +++ b/tests/SmokeTests/MongoDB.Driver.SmokeTests.Sdk/LoggingTests.cs @@ -23,6 +23,7 @@ namespace MongoDB.Driver.SmokeTests.Sdk { + [Trait("Category", "Integration")] public sealed class LoggingTests { private readonly ITestOutputHelper _output; From 27db2b79dd82da7d5bc4f258699a9f474b47c357 Mon Sep 17 00:00:00 2001 From: Oleksandr Poliakov Date: Fri, 16 May 2025 17:43:38 -0700 Subject: [PATCH 2/4] Add macos --- evergreen/evergreen.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/evergreen/evergreen.yml b/evergreen/evergreen.yml index 7dad720af02..cee1edcd427 100644 --- a/evergreen/evergreen.yml +++ b/evergreen/evergreen.yml @@ -2244,6 +2244,24 @@ buildvariants: - 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-netstandard21 + - 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}" From 024d3ecae89e0a930f2a2a2d20603284e84f7f62 Mon Sep 17 00:00:00 2001 From: Oleksandr Poliakov Date: Fri, 16 May 2025 17:48:15 -0700 Subject: [PATCH 3/4] Fix ARM variant --- evergreen/evergreen.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/evergreen/evergreen.yml b/evergreen/evergreen.yml index cee1edcd427..7437891078c 100644 --- a/evergreen/evergreen.yml +++ b/evergreen/evergreen.yml @@ -2259,7 +2259,6 @@ buildvariants: expansions: OS: "macos-14-arm64" tasks: - - name: unit-tests-netstandard21 - name: unit-tests-net60 - matrix_name: stable-api-tests From 852f9500acb0b6f8b476f194b5f0f9e8afed84b3 Mon Sep 17 00:00:00 2001 From: Oleksandr Poliakov Date: Tue, 20 May 2025 10:42:06 -0700 Subject: [PATCH 4/4] PR --- .../MongoQueryableEnumComparedToEnumTests.cs | 1 - ...eEnumComparedToEnumWithStringRepresentationTests.cs | 1 - ...ngoQueryableIntArrayComparedToEnumerableIntTests.cs | 1 - .../MongoQueryableIntComparedToDoubleTests.cs | 1 - ...IntComparedToDoubleWithStringRepresentationTests.cs | 1 - .../MongoQueryableIntComparedToNullableIntTests.cs | 1 - ...mparedToNullableIntWithStringRepresentationTests.cs | 1 - ...QueryableNullableEnumComparedToNullableEnumTests.cs | 1 - ...paredToNullableEnumWithStringRepresentationTests.cs | 1 - .../MongoQueryableWithDotNotationTests.cs | 1 - .../Translators/LegacyPredicateTranslatorTests.cs | 2 -- .../Translators/PredicateTranslatorValidationTests.cs | 3 +-- .../PipelineStageDefinitionBuilderTests.cs | 10 ---------- .../prose-tests/RetryWriteOnOtherMongos.cs | 1 - 14 files changed, 1 insertion(+), 25 deletions(-) diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableEnumComparedToEnumTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableEnumComparedToEnumTests.cs index df5918efdd7..1c3ff6f6226 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableEnumComparedToEnumTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableEnumComparedToEnumTests.cs @@ -18,7 +18,6 @@ using MongoDB.Bson; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; -using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableEnumComparedToEnumWithStringRepresentationTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableEnumComparedToEnumWithStringRepresentationTests.cs index ce56f7e500a..caf157ce7d3 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableEnumComparedToEnumWithStringRepresentationTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableEnumComparedToEnumWithStringRepresentationTests.cs @@ -19,7 +19,6 @@ using MongoDB.Bson.Serialization.Attributes; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; -using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntArrayComparedToEnumerableIntTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntArrayComparedToEnumerableIntTests.cs index 71a24a6633a..c8280dc4756 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntArrayComparedToEnumerableIntTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntArrayComparedToEnumerableIntTests.cs @@ -19,7 +19,6 @@ using MongoDB.Bson; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; -using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToDoubleTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToDoubleTests.cs index c0b0fa54906..6cf5a074a35 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToDoubleTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToDoubleTests.cs @@ -18,7 +18,6 @@ using MongoDB.Bson; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; -using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToDoubleWithStringRepresentationTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToDoubleWithStringRepresentationTests.cs index 39801df0203..511d103038b 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToDoubleWithStringRepresentationTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToDoubleWithStringRepresentationTests.cs @@ -19,7 +19,6 @@ using MongoDB.Bson.Serialization.Attributes; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; -using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToNullableIntTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToNullableIntTests.cs index 0421363db92..c98b57fb299 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToNullableIntTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToNullableIntTests.cs @@ -18,7 +18,6 @@ using MongoDB.Bson; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; -using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToNullableIntWithStringRepresentationTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToNullableIntWithStringRepresentationTests.cs index fe24b33a30f..96a07f29d6a 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToNullableIntWithStringRepresentationTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableIntComparedToNullableIntWithStringRepresentationTests.cs @@ -19,7 +19,6 @@ using MongoDB.Bson.Serialization.Attributes; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; -using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableNullableEnumComparedToNullableEnumTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableNullableEnumComparedToNullableEnumTests.cs index aead940be88..945210f690c 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableNullableEnumComparedToNullableEnumTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableNullableEnumComparedToNullableEnumTests.cs @@ -18,7 +18,6 @@ using MongoDB.Bson; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; -using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableNullableEnumComparedToNullableEnumWithStringRepresentationTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableNullableEnumComparedToNullableEnumWithStringRepresentationTests.cs index d54e719e597..dd8ccf9e5d8 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableNullableEnumComparedToNullableEnumWithStringRepresentationTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableNullableEnumComparedToNullableEnumWithStringRepresentationTests.cs @@ -19,7 +19,6 @@ using MongoDB.Bson.Serialization.Attributes; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; -using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableWithDotNotationTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableWithDotNotationTests.cs index 7865978cd41..f43d71146fe 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableWithDotNotationTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/MongoQueryableWithDotNotationTests.cs @@ -20,7 +20,6 @@ using MongoDB.Bson; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; -using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/Translators/LegacyPredicateTranslatorTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/Translators/LegacyPredicateTranslatorTests.cs index 019de4d5ee5..cd49af1955f 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/Translators/LegacyPredicateTranslatorTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/Translators/LegacyPredicateTranslatorTests.cs @@ -22,12 +22,10 @@ using MongoDB.Bson; using MongoDB.Bson.Serialization; using MongoDB.Bson.Serialization.Attributes; -using MongoDB.Driver; using MongoDB.Driver.Linq.Linq3Implementation.Ast.Optimizers; using MongoDB.Driver.Linq.Linq3Implementation.Misc; using MongoDB.Driver.Linq.Linq3Implementation.Translators; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToFilterTranslators; -using MongoDB.TestHelpers.XunitExtensions; using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests.Translators diff --git a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/Translators/PredicateTranslatorValidationTests.cs b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/Translators/PredicateTranslatorValidationTests.cs index 49a49a6c212..12d51f85ce8 100644 --- a/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/Translators/PredicateTranslatorValidationTests.cs +++ b/tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationWithLinq2Tests/Translators/PredicateTranslatorValidationTests.cs @@ -21,8 +21,7 @@ using MongoDB.Bson; using MongoDB.Driver.Linq.Linq3Implementation; using MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators; - -using MongoDB.TestHelpers.XunitExtensions;using Xunit; +using Xunit; namespace MongoDB.Driver.Tests.Linq.Linq3ImplementationWithLinq2Tests.Translators { diff --git a/tests/MongoDB.Driver.Tests/PipelineStageDefinitionBuilderTests.cs b/tests/MongoDB.Driver.Tests/PipelineStageDefinitionBuilderTests.cs index 9cf990a7741..1462d3db2be 100644 --- a/tests/MongoDB.Driver.Tests/PipelineStageDefinitionBuilderTests.cs +++ b/tests/MongoDB.Driver.Tests/PipelineStageDefinitionBuilderTests.cs @@ -390,8 +390,6 @@ public void Lookup_without_optional_let_should_return_the_expected_result() [InlineData("database2", "collection2", "{ $merge : { into : { db : 'database2', coll : 'collection2' } } }")] public void Merge_with_default_options_should_return_the_expected_result(string outputDatabaseName, string outputCollectionName, string expectedStage) { - RequireServer.Check(); - var client = DriverTestConfiguration.Client; var outputDatabase = client.GetDatabase(outputDatabaseName); var outputCollection = outputDatabase.GetCollection(outputCollectionName); @@ -409,8 +407,6 @@ public void Merge_with_default_options_should_return_the_expected_result(string [InlineData("{ a : 1, b : 2 }", "{ $merge : { into : { db : 'database', coll : 'collection' }, let : { a : 1, b : 2 }, whenMatched : [{ $project : { _id : '$_id' } }] } }")] public void Merge_with_LetVariables_should_return_the_expected_result(string letVariables, string expectedStage) { - RequireServer.Check(); - var client = DriverTestConfiguration.Client; var outputDatabase = client.GetDatabase("database"); var outputCollection = outputDatabase.GetCollection("collection"); @@ -432,8 +428,6 @@ public void Merge_with_LetVariables_should_return_the_expected_result(string let [InlineData("a,b", "{ $merge : { into : { db : 'database', coll : 'collection' }, on : ['a', 'b'] } }")] public void Merge_with_OnFieldNames_should_return_the_expected_result(string fieldNames, string expectedStage) { - RequireServer.Check(); - var client = DriverTestConfiguration.Client; var outputDatabase = client.GetDatabase("database"); var outputCollection = outputDatabase.GetCollection("collection"); @@ -453,8 +447,6 @@ public void Merge_with_OnFieldNames_should_return_the_expected_result(string fie [InlineData(MergeStageWhenMatched.Replace, "{ $merge : { into : { db : 'database', coll : 'collection' }, whenMatched : 'replace' } }")] public void Merge_with_WhenMatched_should_return_the_expected_result(MergeStageWhenMatched whenMatched, string expectedStage) { - RequireServer.Check(); - var client = DriverTestConfiguration.Client; var outputDatabase = client.GetDatabase("database"); var outputCollection = outputDatabase.GetCollection("collection"); @@ -476,8 +468,6 @@ public void Merge_with_WhenMatched_should_return_the_expected_result(MergeStageW [InlineData(MergeStageWhenNotMatched.Insert, "{ $merge : { into : { db : 'database', coll : 'collection' }, whenNotMatched : 'insert' } }")] public void Merge_with_WhenNotMatched_should_return_the_expected_result(MergeStageWhenNotMatched whenNotMatched, string expectedStage) { - RequireServer.Check(); - var client = DriverTestConfiguration.Client; var outputDatabase = client.GetDatabase("database"); var outputCollection = outputDatabase.GetCollection("collection"); diff --git a/tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/RetryWriteOnOtherMongos.cs b/tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/RetryWriteOnOtherMongos.cs index b7d55d58ecf..75f89943f40 100644 --- a/tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/RetryWriteOnOtherMongos.cs +++ b/tests/MongoDB.Driver.Tests/Specifications/retryable-writes/prose-tests/RetryWriteOnOtherMongos.cs @@ -29,7 +29,6 @@ namespace MongoDB.Driver.Tests.Specifications.retryable_writes.prose_tests { [Trait("Category", "Integration")] - public class RetryWriteOnOtherMongos { [Fact]