Skip to content
This repository was archived by the owner on Apr 20, 2019. It is now read-only.

Commit f65e52d

Browse files
committed
CSHARP-2249: Fix command monitoring JSON tests against latest server version.
1 parent 4ea3f9c commit f65e52d

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

build.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ if($FoundDotNetCliVersion -ne $DotNetVersion) {
8181
if (!(Test-Path $InstallPath)) {
8282
mkdir -Force $InstallPath | Out-Null;
8383
}
84+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;
8485
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, "$InstallPath\dotnet-install.ps1");
8586
& $InstallPath\dotnet-install.ps1 -Channel $DotNetChannel -Version $DotNetVersion -InstallDir $InstallPath;
8687

tests/MongoDB.Driver.Tests/Specifications/command-monitoring/TestRunner.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,20 @@
1414
*/
1515

1616
using System;
17+
using System.Collections;
1718
using System.Collections.Generic;
1819
using System.IO;
1920
using System.Linq;
2021
using System.Reflection;
2122
using System.Threading;
22-
using System.Threading.Tasks;
2323
using FluentAssertions;
2424
using MongoDB.Bson;
25+
using MongoDB.Bson.TestHelpers.XunitExtensions;
2526
using MongoDB.Driver.Core;
2627
using MongoDB.Driver.Core.Clusters.ServerSelectors;
2728
using MongoDB.Driver.Core.Events;
2829
using MongoDB.Driver.Core.Misc;
29-
using MongoDB.Bson.TestHelpers.XunitExtensions;
3030
using Xunit;
31-
using System.Collections;
32-
using MongoDB.Driver.Core.TestHelpers.XunitExtensions;
33-
using MongoDB.Driver.Core.Clusters;
3431

3532
namespace MongoDB.Driver.Tests.Specifications.command_monitoring
3633
{
@@ -106,8 +103,6 @@ public bool OneTimeSetup()
106103
[ClassData(typeof(TestCaseFactory))]
107104
public void RunTestDefinition(IEnumerable<BsonDocument> data, string databaseName, string collectionName, BsonDocument definition, bool async)
108105
{
109-
RequireServer.Check().ClusterTypes(ClusterType.ReplicaSet, ClusterType.Standalone);
110-
111106
definition = (BsonDocument)DeepCopy(definition); // protect against side effects when the same definition is run twice (async=false/true)
112107

113108
BsonValue bsonValue;
@@ -300,6 +295,7 @@ private BsonDocument MassageReply(string commandName, BsonDocument reply, BsonDo
300295
{
301296
writeError["code"] = 42;
302297
writeError["errmsg"] = "";
298+
writeError.Remove("codeName");
303299
}
304300
}
305301
break;

0 commit comments

Comments
 (0)