-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
6 changed files
with
428 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
const { expect } = require('chai'); | ||
const { loadSpecTests } = require('../spec/index'); | ||
const { runUnifiedTest } = require('./unified-spec-runner/runner'); | ||
|
||
describe('Collection management unified spec tests', function () { | ||
for (const collectionManagementTest of loadSpecTests('collection-management')) { | ||
expect(collectionManagementTest).to.exist; | ||
context(String(collectionManagementTest.description), function () { | ||
for (const test of collectionManagementTest.tests) { | ||
it(String(test.description), { | ||
metadata: { sessions: { skipLeakTests: true } }, | ||
test: async function () { | ||
await runUnifiedTest(this, collectionManagementTest, test); | ||
} | ||
}); | ||
} | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
255 changes: 255 additions & 0 deletions
255
test/spec/collection-management/timeseries-collection.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,255 @@ | ||
{ | ||
"description": "timeseries-collection", | ||
"schemaVersion": "1.0", | ||
"runOnRequirements": [ | ||
{ | ||
"minServerVersion": "5.0" | ||
} | ||
], | ||
"createEntities": [ | ||
{ | ||
"client": { | ||
"id": "client0", | ||
"observeEvents": [ | ||
"commandStartedEvent" | ||
] | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database0", | ||
"client": "client0", | ||
"databaseName": "ts-tests" | ||
} | ||
}, | ||
{ | ||
"collection": { | ||
"id": "collection0", | ||
"database": "database0", | ||
"collectionName": "test" | ||
} | ||
} | ||
], | ||
"initialData": [ | ||
{ | ||
"collectionName": "test", | ||
"databaseName": "ts-tests", | ||
"documents": [] | ||
} | ||
], | ||
"tests": [ | ||
{ | ||
"description": "createCollection with all options", | ||
"operations": [ | ||
{ | ||
"name": "dropCollection", | ||
"object": "database0", | ||
"arguments": { | ||
"collection": "test" | ||
} | ||
}, | ||
{ | ||
"name": "createCollection", | ||
"object": "database0", | ||
"arguments": { | ||
"collection": "test", | ||
"expireAfterSeconds": 604800, | ||
"timeseries": { | ||
"timeField": "time", | ||
"metaField": "meta", | ||
"granularity": "minutes" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "assertCollectionExists", | ||
"object": "testRunner", | ||
"arguments": { | ||
"databaseName": "ts-tests", | ||
"collectionName": "test" | ||
} | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client0", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"drop": "test" | ||
}, | ||
"databaseName": "ts-tests" | ||
} | ||
}, | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"create": "test", | ||
"expireAfterSeconds": 604800, | ||
"timeseries": { | ||
"timeField": "time", | ||
"metaField": "meta", | ||
"granularity": "minutes" | ||
} | ||
}, | ||
"databaseName": "ts-tests" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"description": "insertMany with duplicate ids", | ||
"operations": [ | ||
{ | ||
"name": "dropCollection", | ||
"object": "database0", | ||
"arguments": { | ||
"collection": "test" | ||
} | ||
}, | ||
{ | ||
"name": "createCollection", | ||
"object": "database0", | ||
"arguments": { | ||
"collection": "test", | ||
"expireAfterSeconds": 604800, | ||
"timeseries": { | ||
"timeField": "time", | ||
"metaField": "meta", | ||
"granularity": "minutes" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "assertCollectionExists", | ||
"object": "testRunner", | ||
"arguments": { | ||
"databaseName": "ts-tests", | ||
"collectionName": "test" | ||
} | ||
}, | ||
{ | ||
"name": "insertMany", | ||
"object": "collection0", | ||
"arguments": { | ||
"documents": [ | ||
{ | ||
"_id": 1, | ||
"time": { | ||
"$date": { | ||
"$numberLong": "1552949630482" | ||
} | ||
} | ||
}, | ||
{ | ||
"_id": 1, | ||
"time": { | ||
"$date": { | ||
"$numberLong": "1552949630483" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "find", | ||
"object": "collection0", | ||
"arguments": { | ||
"filter": {}, | ||
"sort": { | ||
"time": 1 | ||
} | ||
}, | ||
"expectResult": [ | ||
{ | ||
"_id": 1, | ||
"time": { | ||
"$date": { | ||
"$numberLong": "1552949630482" | ||
} | ||
} | ||
}, | ||
{ | ||
"_id": 1, | ||
"time": { | ||
"$date": { | ||
"$numberLong": "1552949630483" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client0", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"drop": "test" | ||
}, | ||
"databaseName": "ts-tests" | ||
} | ||
}, | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"create": "test", | ||
"expireAfterSeconds": 604800, | ||
"timeseries": { | ||
"timeField": "time", | ||
"metaField": "meta", | ||
"granularity": "minutes" | ||
} | ||
}, | ||
"databaseName": "ts-tests" | ||
} | ||
}, | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"insert": "test", | ||
"documents": [ | ||
{ | ||
"_id": 1, | ||
"time": { | ||
"$date": { | ||
"$numberLong": "1552949630482" | ||
} | ||
} | ||
}, | ||
{ | ||
"_id": 1, | ||
"time": { | ||
"$date": { | ||
"$numberLong": "1552949630483" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"find": "test", | ||
"filter": {}, | ||
"sort": { | ||
"time": 1 | ||
} | ||
}, | ||
"databaseName": "ts-tests" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.