Skip to content

Commit 0128d3e

Browse files
committed
CSHARP-2248: Synchronize JSON drive test files between .NET Framework and .NET Core
1 parent 6423ab5 commit 0128d3e

File tree

215 files changed

+13372
-6263
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+13372
-6263
lines changed

tests/MongoDB.Bson.Tests.Dotnet/MongoDB.Bson.Tests.Dotnet.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
<PackageReference Include="Moq" Version="4.6.36-alpha" />
3838
</ItemGroup>
3939

40+
<ItemGroup>
41+
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
42+
</ItemGroup>
43+
4044
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
4145
<DefineConstants>$(DefineConstants);NETSTANDARD1_5</DefineConstants>
4246
</PropertyGroup>

tests/MongoDB.Driver.Core.Tests.Dotnet/MongoDB.Driver.Core.Tests.Dotnet.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
<PackageReference Include="Moq" Version="4.6.36-alpha" />
3838
</ItemGroup>
3939

40+
<ItemGroup>
41+
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
42+
</ItemGroup>
43+
4044
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
4145
<DefineConstants>$(DefineConstants);NETSTANDARD1_5</DefineConstants>
4246
</PropertyGroup>

tests/MongoDB.Driver.Core.Tests.Dotnet/Specifications/server-discovery-and-monitoring/tests/Makefile

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/MongoDB.Driver.Core.Tests.Dotnet/Specifications/server-discovery-and-monitoring/tests/README.rst

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,6 @@ The YAML and JSON files in this directory tree are platform-independent tests
66
that drivers can use to prove their conformance to the
77
Server Discovery And Monitoring Spec.
88

9-
Converting to JSON
10-
------------------
11-
12-
The tests are written in YAML
13-
because it is easier for humans to write and read,
14-
and because YAML includes a standard comment format.
15-
A JSONified version of each YAML file is included in this repository.
16-
Whenever you change the YAML, re-convert to JSON.
17-
One method to convert to JSON is with
18-
`jsonwidget-python <http://jsonwidget.org/wiki/Jsonwidget-python>`_::
19-
20-
pip install PyYAML urwid jsonwidget
21-
make
22-
23-
Or instead of "make"::
24-
25-
for i in `find . -iname '*.yml'`; do
26-
echo "${i%.*}"
27-
jwc yaml2json $i > ${i%.*}.json
28-
done
29-
309
Version
3110
-------
3211

@@ -71,6 +50,8 @@ processing the responses in the phases so far. It has the following keys:
7150
- setName: A string with the expected replica set name, or null.
7251
- servers: An object whose keys are addresses like "a:27017", and whose values
7352
are "server" objects.
53+
- logicalSessionTimeoutMinutes: null or an integer.
54+
- compatible: absent or a bool.
7455

7556
A "server" object represents a correct ServerDescription within the client's
7657
current TopologyDescription. It has the following keys:
@@ -79,6 +60,9 @@ current TopologyDescription. It has the following keys:
7960
- setName: A string with the expected replica set name, or null.
8061
- setVersion: absent or an integer.
8162
- electionId: absent, null, or an ObjectId.
63+
- logicalSessionTimeoutMinutes: absent, null, or an integer.
64+
- minWireVersion: absent or an integer.
65+
- maxWireVersion: absent or an integer.
8266

8367
Use as unittests
8468
----------------
@@ -123,4 +107,9 @@ If a response is the empty object `{}`, simulate a network error.
123107
Once all responses are processed, assert that the phase's "outcome" object
124108
is equivalent to the driver's current TopologyDescription.
125109

110+
Some fields such as "logicalSessionTimeoutMinutes" or "compatible" were added
111+
later and haven't been added to all test files. If these fields are present,
112+
test that they are equivalent to the fields of the driver's current
113+
TopologyDescription.
114+
126115
Continue until all phases have been executed.

tests/MongoDB.Driver.Core.Tests.Dotnet/Specifications/server-discovery-and-monitoring/tests/monitoring/replica_set_with_no_primary.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"setVersion": 1,
1515
"primary": "b:27017",
1616
"hosts": [
17-
"a:27017", "b:27017"
17+
"a:27017",
18+
"b:27017"
1819
],
1920
"minWireVersion": 0,
2021
"maxWireVersion": 4
@@ -83,7 +84,8 @@
8384
"address": "a:27017",
8485
"arbiters": [],
8586
"hosts": [
86-
"a:27017", "b:27017"
87+
"a:27017",
88+
"b:27017"
8789
],
8890
"passives": [],
8991
"primary": "b:27017",
@@ -122,7 +124,8 @@
122124
"address": "a:27017",
123125
"arbiters": [],
124126
"hosts": [
125-
"a:27017", "b:27017"
127+
"a:27017",
128+
"b:27017"
126129
],
127130
"passives": [],
128131
"primary": "b:27017",

tests/MongoDB.Driver.Core.Tests.Dotnet/Specifications/server-discovery-and-monitoring/tests/monitoring/replica_set_with_primary.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"setVersion": 1,
1414
"primary": "a:27017",
1515
"hosts": [
16-
"a:27017", "b:27017"
16+
"a:27017",
17+
"b:27017"
1718
],
1819
"minWireVersion": 0,
1920
"maxWireVersion": 4
@@ -82,7 +83,8 @@
8283
"address": "a:27017",
8384
"arbiters": [],
8485
"hosts": [
85-
"a:27017", "b:27017"
86+
"a:27017",
87+
"b:27017"
8688
],
8789
"passives": [],
8890
"primary": "a:27017",
@@ -121,7 +123,8 @@
121123
"address": "a:27017",
122124
"arbiters": [],
123125
"hosts": [
124-
"a:27017", "b:27017"
126+
"a:27017",
127+
"b:27017"
125128
],
126129
"passives": [],
127130
"primary": "a:27017",

0 commit comments

Comments
 (0)