Skip to content

Commit 00c4853

Browse files
ADL tests
1 parent e4956f4 commit 00c4853

31 files changed

+737
-421
lines changed

test/manual/atlas-data-lake-testing/atlas_data_lake_testing.spec.js

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import path = require('path');
2+
3+
import { loadSpecTests } from '../../spec';
4+
import { runUnifiedSuite } from '../../tools/unified-spec-runner/runner';
5+
6+
describe('Atlas Data Lake Unified Tests', function () {
7+
runUnifiedSuite(loadSpecTests(path.join('atlas-data-lake-testing', 'unified')));
8+
});
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Atlas Data Lake Tests
2+
3+
## Introduction
4+
5+
The YAML and JSON files in this directory are platform-independent tests that drivers can use to assert compatibility
6+
with [Atlas Data Lake](https://www.mongodb.com/docs/datalake/). These tests utilize the
7+
[Unified Test Format](../../unified-test-format/unified-test-format.md).
8+
9+
Several prose tests, which are not easily expressed in YAML, are also presented in this file. Those tests will need to
10+
be manually implemented by each driver.
11+
12+
## Test Considerations
13+
14+
Running these integration tests will require a running `mongohoused` with data available in its `test.driverdata`
15+
collection. See the
16+
[ADL directory in drivers-evergreen-tools](https://github.com/mongodb-labs/drivers-evergreen-tools/tree/master/.evergreen/atlas_data_lake)
17+
and [10gen/mongohouse README](https://github.com/10gen/mongohouse/blob/master/README.md) for more information.
18+
19+
The test runner for Atlas Data Lake testing MUST NOT drop the collection and/or database under test. In contrast to most
20+
other tests, which insert their own data fixtures into an empty collection, the data for these tests is specified in the
21+
`mongohoused` configuration file.
22+
23+
Additionally, the test runner MUST NOT execute `killAllSessions` (see:
24+
[Terminating Open Transactions](../../unified-test-format/unified-test-format.md#terminating-open-transactions)) when
25+
connected to Atlas Data Lake.
26+
27+
## Prose Tests
28+
29+
The following tests MUST be implemented to fully test compatibility with Atlas Data Lake.
30+
31+
### 1. Support for `killCursors` command
32+
33+
Test that the driver properly constructs and issues a
34+
[killCursors](https://www.mongodb.com/docs/manual/reference/command/killCursors/) command to Atlas Data Lake. For this
35+
test, configure an APM listener on a client and execute a query on the `test.driverdata` collection that will leave a
36+
cursor open on the server (e.g. specify `batchSize=2` for a query that would match 3+ documents). Drivers MAY iterate
37+
the cursor if necessary to execute the initial `find` command but MUST NOT iterate further to avoid executing a
38+
`getMore`.
39+
40+
Observe the CommandSucceededEvent event for the `find` command and extract the cursor's ID and namespace from the
41+
response document's `cursor.id` and `cursor.ns` fields, respectively. Destroy the cursor object and observe a
42+
CommandStartedEvent and CommandSucceededEvent for the `killCursors` command. Assert that the cursor ID and target
43+
namespace in the outgoing command match the values from the `find` command's CommandSucceededEvent. When matching the
44+
namespace, note that the `killCursors` field will contain the collection name and the database may be inferred from
45+
either the `$db` field or accessed via the CommandStartedEvent directly. Finally, assert that the `killCursors`
46+
CommandSucceededEvent indicates that the expected cursor was killed in the `cursorsKilled` field.
47+
48+
Note: this test assumes that drivers only issue a `killCursors` command internally when destroying a cursor that may
49+
still exist on the server. If a driver constructs and issues `killCursors` commands in other ways (e.g. public API),
50+
this test MUST be adapted to test all such code paths.
51+
52+
### 2. Connect without authentication
53+
54+
Test that the driver can establish a connection with Atlas Data Lake without authentication. For these tests, create a
55+
MongoClient using a valid connection string without auth credentials and execute a ping command.
56+
57+
### 3. Connect with authentication
58+
59+
Test that the driver can establish a connection with Atlas Data Lake with authentication. For these tests, create a
60+
MongoClient using a valid connection string with SCRAM-SHA-1 and credentials from the drivers-evergreen-tools ADL
61+
configuration and execute a ping command. Repeat this test using SCRAM-SHA-256.
62+
63+
## Changelog
64+
65+
- 2024-03-08: Convert legacy ADL tests to unified format. Convert test README from reStructuredText to Markdown.
66+
67+
- 2022-10-05: Add spec front matter
68+
69+
- 2020-07-15: Link to CRUD test runner implementation and note that the collection under test must not be dropped before
70+
each test.

test/spec/atlas-data-lake-testing/aggregate.json

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

test/spec/atlas-data-lake-testing/aggregate.yml

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

test/spec/atlas-data-lake-testing/estimatedDocumentCount.json

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

test/spec/atlas-data-lake-testing/estimatedDocumentCount.yml

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

test/spec/atlas-data-lake-testing/find.yml

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

test/spec/atlas-data-lake-testing/getMore.json

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

test/spec/atlas-data-lake-testing/getMore.yml

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

test/spec/atlas-data-lake-testing/listCollections.json

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

0 commit comments

Comments
 (0)