Skip to content

Commit 350d14f

Browse files
authored
chore: add the unified spec tests (#2688)
1 parent 421fe6e commit 350d14f

File tree

295 files changed

+11084
-0
lines changed

Some content is hidden

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

295 files changed

+11084
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
SCHEMA=../schema-1.1.json
2+
3+
.PHONY: all invalid valid-fail valid-pass versioned-api HAS_AJV
4+
5+
all: invalid valid-fail valid-pass versioned-api
6+
7+
invalid: HAS_AJV
8+
@# Redirect stdout to hide expected validation errors
9+
@ajv test -s $(SCHEMA) -d "invalid/*.yml" --invalid > /dev/null && echo "invalid/*.yml passed test"
10+
11+
valid-fail: HAS_AJV
12+
@ajv test -s $(SCHEMA) -d "valid-fail/*.yml" --valid
13+
14+
valid-pass: HAS_AJV
15+
@ajv test -s $(SCHEMA) -d "valid-pass/*.yml" --valid
16+
17+
versioned-api: HAS_AJV
18+
@ajv test -s $(SCHEMA) -d "../../versioned-api/tests/*.yml" --valid
19+
20+
HAS_AJV:
21+
@if ! command -v ajv > /dev/null; then \
22+
echo 'Error: need "npm install -g ajv-cli"' 1>&2; \
23+
exit 1; \
24+
fi
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"description": "collectionData-additionalProperties",
3+
"schemaVersion": "1.0",
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+
"foo": 0
23+
}
24+
}
25+
],
26+
"initialData": [
27+
{
28+
"collectionName": "foo",
29+
"databaseName": "foo",
30+
"documents": [],
31+
"foo": 0
32+
}
33+
],
34+
"tests": [
35+
{
36+
"description": "foo",
37+
"operations": []
38+
}
39+
]
40+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
description: "collectionData-additionalProperties"
2+
3+
schemaVersion: "1.0"
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+
foo: 0
17+
18+
initialData:
19+
- collectionName: *collection0Name
20+
databaseName: *database0Name
21+
documents: []
22+
foo: 0
23+
24+
tests:
25+
- description: "foo"
26+
operations: []
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"description": "collectionData-collectionName-required",
3+
"schemaVersion": "1.0",
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+
"foo": 0
23+
}
24+
}
25+
],
26+
"initialData": [
27+
{
28+
"databaseName": "foo",
29+
"documents": []
30+
}
31+
],
32+
"tests": [
33+
{
34+
"description": "foo",
35+
"operations": []
36+
}
37+
]
38+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
description: "collectionData-collectionName-required"
2+
3+
schemaVersion: "1.0"
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+
foo: 0
17+
18+
initialData:
19+
- databaseName: *database0Name
20+
documents: []
21+
22+
tests:
23+
- description: "foo"
24+
operations: []
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"description": "collectionData-collectionName-type",
3+
"schemaVersion": "1.0",
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+
"foo": 0
23+
}
24+
}
25+
],
26+
"initialData": [
27+
{
28+
"collectionName": 0,
29+
"databaseName": "foo",
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-collectionName-type"
2+
3+
schemaVersion: "1.0"
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+
foo: 0
17+
18+
initialData:
19+
- collectionName: 0
20+
databaseName: *database0Name
21+
documents: []
22+
23+
tests:
24+
- description: "foo"
25+
operations: []
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"description": "collectionData-databaseName-required",
3+
"schemaVersion": "1.0",
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+
"foo": 0
23+
}
24+
}
25+
],
26+
"initialData": [
27+
{
28+
"collectionName": "foo",
29+
"documents": []
30+
}
31+
],
32+
"tests": [
33+
{
34+
"description": "foo",
35+
"operations": []
36+
}
37+
]
38+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
description: "collectionData-databaseName-required"
2+
3+
schemaVersion: "1.0"
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+
foo: 0
17+
18+
initialData:
19+
- collectionName: *collection0Name
20+
documents: []
21+
22+
tests:
23+
- description: "foo"
24+
operations: []
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"description": "collectionData-databaseName-type",
3+
"schemaVersion": "1.0",
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+
"foo": 0
23+
}
24+
}
25+
],
26+
"initialData": [
27+
{
28+
"collectionName": "foo",
29+
"databaseName": 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-databaseName-type"
2+
3+
schemaVersion: "1.0"
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+
foo: 0
17+
18+
initialData:
19+
- collectionName: *collection0Name
20+
databaseName: 0
21+
documents: []
22+
23+
tests:
24+
- description: "foo"
25+
operations: []
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"description": "collectionData-documents-items",
3+
"schemaVersion": "1.0",
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+
"foo": 0
23+
}
24+
}
25+
],
26+
"initialData": [
27+
{
28+
"collectionName": "foo",
29+
"databaseName": "foo",
30+
"documents": [
31+
0
32+
]
33+
}
34+
],
35+
"tests": [
36+
{
37+
"description": "foo",
38+
"operations": []
39+
}
40+
]
41+
}

0 commit comments

Comments
 (0)