Skip to content

Commit 592b4ff

Browse files
committed
Configure tests that were failing with certain cluster types to only run in supported cluster types.
1 parent edf672c commit 592b4ff

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/MongoDB.Driver.Core.Tests/Core/Operations/ListCollectionsUsingQueryOperationTests.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void Filter_get_and_set_should_work()
7272
}
7373

7474
[Test]
75-
[RequiresServer("EnsureCollectionsExist", StorageEngines = "mmapv1")]
75+
[RequiresServer("EnsureCollectionsExist", ClusterTypes = ClusterTypes.StandaloneOrReplicaSet, StorageEngines = "mmapv1")]
7676
public void Execute_should_return_the_expected_result(
7777
[Values(false, true)]
7878
bool async)
@@ -91,7 +91,7 @@ public void Execute_should_return_the_expected_result(
9191
[TestCase("{ name : \"regular\" }", "regular", true)]
9292
[TestCase("{ \"options.capped\" : true }", "capped", false)]
9393
[TestCase("{ \"options.capped\" : true }", "capped", true)]
94-
[RequiresServer("EnsureCollectionsExist", StorageEngines = "mmapv1")]
94+
[RequiresServer("EnsureCollectionsExist", ClusterTypes = ClusterTypes.StandaloneOrReplicaSet, StorageEngines = "mmapv1")]
9595
public void Execute_should_return_the_expected_result_when_filter_is_used(string filterString, string expectedName, bool async)
9696
{
9797
var filter = BsonDocument.Parse(filterString);
@@ -108,7 +108,7 @@ public void Execute_should_return_the_expected_result_when_filter_is_used(string
108108
}
109109

110110
[Test]
111-
[RequiresServer(StorageEngines = "mmapv1")]
111+
[RequiresServer(ClusterTypes = ClusterTypes.StandaloneOrReplicaSet, StorageEngines = "mmapv1")]
112112
public void Execute_should_return_the_expected_result_when_the_database_does_not_exist(
113113
[Values(false, true)]
114114
bool async)
@@ -123,7 +123,7 @@ public void Execute_should_return_the_expected_result_when_the_database_does_not
123123
}
124124

125125
[Test]
126-
[RequiresServer(VersionLessThan = "2.7.0")]
126+
[RequiresServer(VersionLessThan = "2.7.0", ClusterTypes = ClusterTypes.StandaloneOrReplicaSet)]
127127
public void Execute_should_throw_when_filter_name_is_not_a_string_and_connected_to_older_server(
128128
[Values(false, true)]
129129
bool async)

src/MongoDB.Driver.Core.Tests/Core/Operations/ListIndexesUsingQueryOperationTests.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void constructor_should_throw_when_collectionNamespace_is_null()
5757
}
5858

5959
[Test]
60-
[RequiresServer(StorageEngines = "mmapv1")]
60+
[RequiresServer(ClusterTypes = ClusterTypes.StandaloneOrReplicaSet, StorageEngines = "mmapv1")]
6161
public void Execute_should_return_expected_result(
6262
[Values(false, true)]
6363
bool async)
@@ -72,7 +72,7 @@ public void Execute_should_return_expected_result(
7272
}
7373

7474
[Test]
75-
[RequiresServer(StorageEngines = "mmapv1")]
75+
[RequiresServer(ClusterTypes = ClusterTypes.StandaloneOrReplicaSet, StorageEngines = "mmapv1")]
7676
public void Execute_should_return_expected_result_when_collection_does_not_exist(
7777
[Values(false, true)]
7878
bool async)
@@ -87,7 +87,7 @@ public void Execute_should_return_expected_result_when_collection_does_not_exist
8787
}
8888

8989
[Test]
90-
[RequiresServer(StorageEngines = "mmapv1")]
90+
[RequiresServer(ClusterTypes = ClusterTypes.StandaloneOrReplicaSet, StorageEngines = "mmapv1")]
9191
public void Execute_should_return_expected_result_when_database_does_not_exist(
9292
[Values(false, true)]
9393
bool async)

src/MongoDB.Driver.Legacy.Tests/Operations/CurrentOpOperationTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void CreateOperation_should_return_expected_result_when_server_version_do
8282
}
8383

8484
[Test]
85-
[RequiresServer]
85+
[RequiresServer(MinimumVersion = "3.1.2")]
8686
public void Execute_should_return_expected_result()
8787
{
8888
var subject = new CurrentOpOperation(_adminDatabaseNamespace, _messageEncoderSettings);

src/MongoDB.Driver.Legacy.Tests/Operations/CurrentOpUsingCommandOperation.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void CreateOperation_should_return_expected_result()
7272
}
7373

7474
[Test]
75-
[RequiresServer(MinimumVersion = "3.1.1")]
75+
[RequiresServer(MinimumVersion = "3.1.2")]
7676
public void Execute_should_return_expected_result()
7777
{
7878
var subject = new CurrentOpUsingCommandOperation(_adminDatabaseNamespace, _messageEncoderSettings);

0 commit comments

Comments
 (0)