Skip to content

Commit a8a7d01

Browse files
author
Divjot Arora
authored
DRIVERS-555 Unified test format changes for CSOT (#959)
Add timeoutMS, createEntities, createOptions, and $$lte.
1 parent b8371ea commit a8a7d01

33 files changed

+1318
-48
lines changed

source/unified-test-format/schema-1.9.json

Lines changed: 563 additions & 0 deletions
Large diffs are not rendered by default.

source/unified-test-format/tests/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SCHEMA=../schema-1.8.json
1+
SCHEMA=../schema-1.9.json
22

33
.PHONY: all invalid valid-fail valid-pass versioned-api load-balancers gridfs transactions crud collection-management sessions command-monitoring HAS_AJV
44

source/unified-test-format/tests/invalid/collectionData-additionalProperties.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"collection": {
1919
"id": "collection0",
2020
"database": "database0",
21-
"collectionName": "foo",
22-
"foo": 0
21+
"collectionName": "foo"
2322
}
2423
}
2524
],

source/unified-test-format/tests/invalid/collectionData-additionalProperties.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ createEntities:
1313
id: &collection0 "collection0"
1414
database: *database0
1515
collectionName: &collection0Name "foo"
16-
foo: 0
1716

1817
initialData:
1918
- collectionName: *collection0Name

source/unified-test-format/tests/invalid/collectionData-collectionName-required.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"collection": {
1919
"id": "collection0",
2020
"database": "database0",
21-
"collectionName": "foo",
22-
"foo": 0
21+
"collectionName": "foo"
2322
}
2423
}
2524
],

source/unified-test-format/tests/invalid/collectionData-collectionName-required.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ createEntities:
1313
id: &collection0 "collection0"
1414
database: *database0
1515
collectionName: &collection0Name "foo"
16-
foo: 0
1716

1817
initialData:
1918
- databaseName: *database0Name

source/unified-test-format/tests/invalid/collectionData-collectionName-type.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"collection": {
1919
"id": "collection0",
2020
"database": "database0",
21-
"collectionName": "foo",
22-
"foo": 0
21+
"collectionName": "foo"
2322
}
2423
}
2524
],

source/unified-test-format/tests/invalid/collectionData-collectionName-type.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ createEntities:
1313
id: &collection0 "collection0"
1414
database: *database0
1515
collectionName: &collection0Name "foo"
16-
foo: 0
1716

1817
initialData:
1918
- collectionName: 0
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"description": "collectionData-createOptions-type",
3+
"schemaVersion": "1.9",
4+
"createEntities": [
5+
{
6+
"client": {
7+
"id": "client0"
8+
}
9+
},
10+
{
11+
"database": {
12+
"id": "database0",
13+
"client": "client0",
14+
"databaseName": "foo"
15+
}
16+
},
17+
{
18+
"collection": {
19+
"id": "collection0",
20+
"database": "database0",
21+
"collectionName": "foo"
22+
}
23+
}
24+
],
25+
"initialData": [
26+
{
27+
"collectionName": "foo",
28+
"databaseName": "foo",
29+
"createOptions": 0,
30+
"documents": []
31+
}
32+
],
33+
"tests": [
34+
{
35+
"description": "foo",
36+
"operations": []
37+
}
38+
]
39+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
description: "collectionData-createOptions-type"
2+
3+
schemaVersion: "1.9"
4+
5+
createEntities:
6+
- client:
7+
id: &client0 "client0"
8+
- database:
9+
id: &database0 "database0"
10+
client: *client0
11+
databaseName: &database0Name "foo"
12+
- collection:
13+
id: &collection0 "collection0"
14+
database: *database0
15+
collectionName: &collection0Name "foo"
16+
17+
initialData:
18+
- collectionName: *collection0Name
19+
databaseName: *database0Name
20+
createOptions: 0
21+
documents: []
22+
23+
tests:
24+
- description: "foo"
25+
operations: []

source/unified-test-format/tests/invalid/collectionData-databaseName-required.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"collection": {
1919
"id": "collection0",
2020
"database": "database0",
21-
"collectionName": "foo",
22-
"foo": 0
21+
"collectionName": "foo"
2322
}
2423
}
2524
],

source/unified-test-format/tests/invalid/collectionData-databaseName-required.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ createEntities:
1313
id: &collection0 "collection0"
1414
database: *database0
1515
collectionName: &collection0Name "foo"
16-
foo: 0
1716

1817
initialData:
1918
- collectionName: *collection0Name

source/unified-test-format/tests/invalid/collectionData-databaseName-type.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"collection": {
1919
"id": "collection0",
2020
"database": "database0",
21-
"collectionName": "foo",
22-
"foo": 0
21+
"collectionName": "foo"
2322
}
2423
}
2524
],

source/unified-test-format/tests/invalid/collectionData-databaseName-type.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ createEntities:
1313
id: &collection0 "collection0"
1414
database: *database0
1515
collectionName: &collection0Name "foo"
16-
foo: 0
1716

1817
initialData:
1918
- collectionName: *collection0Name

source/unified-test-format/tests/invalid/collectionData-documents-items.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"collection": {
1919
"id": "collection0",
2020
"database": "database0",
21-
"collectionName": "foo",
22-
"foo": 0
21+
"collectionName": "foo"
2322
}
2423
}
2524
],

source/unified-test-format/tests/invalid/collectionData-documents-items.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ createEntities:
1313
id: &collection0 "collection0"
1414
database: *database0
1515
collectionName: &collection0Name "foo"
16-
foo: 0
1716

1817
initialData:
1918
- collectionName: *collection0Name

source/unified-test-format/tests/invalid/collectionData-documents-required.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"collection": {
1919
"id": "collection0",
2020
"database": "database0",
21-
"collectionName": "foo",
22-
"foo": 0
21+
"collectionName": "foo"
2322
}
2423
}
2524
],

source/unified-test-format/tests/invalid/collectionData-documents-required.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ createEntities:
1313
id: &collection0 "collection0"
1414
database: *database0
1515
collectionName: &collection0Name "foo"
16-
foo: 0
1716

1817
initialData:
1918
- collectionName: *collection0Name

source/unified-test-format/tests/invalid/collectionData-documents-type.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"collection": {
1919
"id": "collection0",
2020
"database": "database0",
21-
"collectionName": "foo",
22-
"foo": 0
21+
"collectionName": "foo"
2322
}
2423
}
2524
],

source/unified-test-format/tests/invalid/collectionData-documents-type.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ createEntities:
1313
id: &collection0 "collection0"
1414
database: *database0
1515
collectionName: &collection0Name "foo"
16-
foo: 0
1716

1817
initialData:
1918
- collectionName: *collection0Name
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"description": "collectionOrDatabaseOptions-timeoutMS-type",
3+
"schemaVersion": "1.9",
4+
"createEntities": [
5+
{
6+
"client": {
7+
"id": "client0"
8+
}
9+
},
10+
{
11+
"database": {
12+
"id": "database0",
13+
"client": "client0",
14+
"databaseName": "foo",
15+
"databaseOptions": {
16+
"timeoutMS": 4.5
17+
}
18+
}
19+
}
20+
],
21+
"tests": [
22+
{
23+
"description": "foo",
24+
"operations": []
25+
}
26+
]
27+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
description: "collectionOrDatabaseOptions-timeoutMS-type"
2+
3+
schemaVersion: "1.9"
4+
5+
createEntities:
6+
- client:
7+
id: &client0 "client0"
8+
- database:
9+
id: &database0 "database0"
10+
client: *client0
11+
databaseName: "foo"
12+
databaseOptions:
13+
timeoutMS: 4.5 # Must be an integer, not a float.
14+
15+
tests:
16+
- description: "foo"
17+
operations: []
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"description": "expectedError-isTimeoutError-type",
3+
"schemaVersion": "1.9",
4+
"createEntities": [
5+
{
6+
"client": {
7+
"id": "client0"
8+
}
9+
}
10+
],
11+
"tests": [
12+
{
13+
"description": "foo",
14+
"operations": [
15+
{
16+
"name": "foo",
17+
"object": "client0",
18+
"expectError": {
19+
"isTimeoutError": 0
20+
}
21+
}
22+
]
23+
}
24+
]
25+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
description: "expectedError-isTimeoutError-type"
2+
3+
schemaVersion: "1.9"
4+
5+
createEntities:
6+
- client:
7+
id: &client0 "client0"
8+
9+
tests:
10+
- description: "foo"
11+
operations:
12+
- name: "foo"
13+
object: *client0
14+
expectError:
15+
isTimeoutError: 0
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"description": "collectionData-createOptions",
3+
"schemaVersion": "1.9",
4+
"runOnRequirements": [
5+
{
6+
"minServerVersion": "3.6"
7+
}
8+
],
9+
"createEntities": [
10+
{
11+
"client": {
12+
"id": "client0"
13+
}
14+
},
15+
{
16+
"database": {
17+
"id": "database0",
18+
"client": "client0",
19+
"databaseName": "database0"
20+
}
21+
},
22+
{
23+
"collection": {
24+
"id": "collection0",
25+
"database": "database0",
26+
"collectionName": "coll0"
27+
}
28+
}
29+
],
30+
"initialData": [
31+
{
32+
"collectionName": "coll0",
33+
"databaseName": "database0",
34+
"createOptions": {
35+
"capped": true,
36+
"size": 512
37+
},
38+
"documents": [
39+
{
40+
"_id": 1,
41+
"x": 11
42+
}
43+
]
44+
}
45+
],
46+
"tests": [
47+
{
48+
"description": "collection is created with the correct options",
49+
"operations": [
50+
{
51+
"name": "runCommand",
52+
"object": "database0",
53+
"arguments": {
54+
"commandName": "collStats",
55+
"command": {
56+
"collStats": "coll0",
57+
"scale": 1
58+
}
59+
},
60+
"expectResult": {
61+
"capped": true,
62+
"maxSize": 512
63+
}
64+
}
65+
]
66+
}
67+
]
68+
}

0 commit comments

Comments
 (0)