Skip to content

Commit 4999af8

Browse files
search indexes
1 parent fa84011 commit 4999af8

File tree

3 files changed

+96
-49
lines changed

3 files changed

+96
-49
lines changed

.evergreen/config.in.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,9 +1663,9 @@ task_groups:
16631663
params:
16641664
working_dir: src
16651665
binary: bash
1666-
add_expansions_to_env: true
16671666
env:
16681667
MONGODB_VERSION: "7.0"
1668+
CLUSTER_PREFIX: dbx-node-search-indexes
16691669
args:
16701670
- ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh
16711671
- command: expansions.update
@@ -1676,7 +1676,6 @@ task_groups:
16761676
params:
16771677
working_dir: src
16781678
binary: bash
1679-
add_expansions_to_env: true
16801679
args:
16811680
- ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
16821681
setup_group_can_fail_task: true

.evergreen/config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4680,9 +4680,9 @@ task_groups:
46804680
params:
46814681
working_dir: src
46824682
binary: bash
4683-
add_expansions_to_env: true
46844683
env:
46854684
MONGODB_VERSION: '7.0'
4685+
CLUSTER_PREFIX: dbx-node-search-indexes
46864686
args:
46874687
- ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh
46884688
- command: expansions.update
@@ -4693,7 +4693,6 @@ task_groups:
46934693
params:
46944694
working_dir: src
46954695
binary: bash
4696-
add_expansions_to_env: true
46974696
args:
46984697
- ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
46994698
setup_group_can_fail_task: true

test/readme.md

Lines changed: 94 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,40 @@ about the types of tests and how to run them.
55

66
## Table of Contents
77

8-
- [About the Tests](#about-the-tests)
9-
- [Running the Tests Locally](#running-the-tests-locally)
10-
- [Running the Tests in Evergreen](#running-the-tests-in-evergreen)
11-
- [Using a Pre-Release Version of a Dependent Library](#using-a-pre-release-version-of-a-dependent-library)
12-
- [Manually Testing the Driver](#manually-testing-the-driver)
13-
- [Writing Tests](#writing-tests)
14-
- [Testing with Special Environments](#testing-with-special-environments)
8+
- [MongoDB Node Driver Test Automation](#mongodb-node-driver-test-automation)
9+
- [Table of Contents](#table-of-contents)
10+
- [About the Tests](#about-the-tests)
11+
- [Spec Tests](#spec-tests)
12+
- [Running the Tests Locally](#running-the-tests-locally)
13+
- [Testing With Authorization-Enabled](#testing-with-authorization-enabled)
14+
- [Testing Different MongoDB Topologies](#testing-different-mongodb-topologies)
15+
- [Running Individual Tests](#running-individual-tests)
16+
- [Running the Tests in Evergreen](#running-the-tests-in-evergreen)
17+
- [Manually Kicking Off Evergreen Builds](#manually-kicking-off-evergreen-builds)
18+
- [Evergreen UI](#evergreen-ui)
19+
- [Evergreen CLI](#evergreen-cli)
20+
- [Setup](#setup)
21+
- [Running the Build](#running-the-build)
22+
- [Using a Pre-Release Version of a Dependent Library](#using-a-pre-release-version-of-a-dependent-library)
23+
- [Manually Testing the Driver](#manually-testing-the-driver)
24+
- [Writing Tests](#writing-tests)
25+
- [Framework](#framework)
26+
- [Skipping Tests](#skipping-tests)
27+
- [Running Benchmarks](#running-benchmarks)
28+
- [Configuration](#configuration)
29+
- [Testing with Special Environments](#testing-with-special-environments)
30+
- [Serverless](#serverless)
31+
- [Load Balanced](#load-balanced)
32+
- [Client-Side Field-Level Encryption (CSFLE)](#client-side-field-level-encryption-csfle)
33+
- [KMIP FLE support tests](#kmip-fle-support-tests)
34+
- [Deployed Atlas Tests](#deployed-atlas-tests)
35+
- [Launching an Atlas Cluster](#launching-an-atlas-cluster)
36+
- [Search Indexes](#search-indexes)
37+
- [Deployed Lambda Tests](#deployed-lambda-tests)
38+
- [TODO Special Env Sections](#todo-special-env-sections)
39+
- [Testing driver changes with mongosh](#testing-driver-changes-with-mongosh)
40+
- [Point mongosh to the driver](#point-mongosh-to-the-driver)
41+
- [Run specific package tests](#run-specific-package-tests)
1542

1643
## About the Tests
1744

@@ -568,44 +595,6 @@ The following steps will walk you through how to run the tests for CSFLE.
568595
569596
To run the functional tests using the crypt shared library instead of `mongocryptd`, download the appropriate version of the crypt shared library for the enterprise server version [here](https://www.mongodb.com/download-center/enterprise/releases) and then set the location of it in the environment variable `CRYPT_SHARED_LIB_PATH`.
570597
571-
#### Testing driver changes with mongosh
572-
573-
These steps require `mongosh` to be available locally. Clone it from GitHub.
574-
575-
`mongosh` uses a `lerna` monorepo. As a result, `mongosh` contains multiple references to the `mongodb` package
576-
in their `package.json`s.
577-
578-
Set up `mongosh` by following the steps in the `mongosh` readme.
579-
580-
##### Point mongosh to the driver
581-
582-
mongosh contains a script that does this. To use the script, create an environment
583-
variable `REPLACE_PACKAGE` that contains a string in the form
584-
`mongodb:<path to your local instance of the driver>`. The package replacement script will replace
585-
all occurrences of `mongodb` with the local path of your driver.
586-
587-
An alternative, which can be useful for
588-
testing a release, is to first run `npm pack` on the driver. This generates a tarball containing all the code
589-
that would be uploaded to `npm` if it were released. Then, set the environment variable `REPLACE_PACKAGE`
590-
with the full path to the file.
591-
592-
Once the environment variable is set, run replace package in `mongosh` with:
593-
```sh
594-
npm run replace:package
595-
```
596-
597-
##### Run specific package tests
598-
599-
`mongosh`'s readme documents how to run its tests. Most likely, it isn't necessary to run all of mongosh's
600-
tests. The `mongosh` readme also documents how to run tests for a particular scope. The scopes are
601-
listed in the `generate_mongosh_tasks.js` evergreen generation script.
602-
603-
For example, to run the `service-provider-server` package, run the following command in `mongosh`:
604-
605-
```shell
606-
lerna run test --scope @mongosh/service-provider-server
607-
```
608-
609598
#### KMIP FLE support tests
610599
611600
1. Install `virtualenv`:
@@ -646,6 +635,28 @@ lerna run test --scope @mongosh/service-provider-server
646635
npx mocha --config test/mocha_mongodb.json test/integration/client-side-encryption/
647636
```
648637
638+
### Deployed Atlas Tests
639+
640+
#### Launching an Atlas Cluster
641+
642+
Using drivers evergreen tools, run the `setup-atlas-cluster` script. You must also set the CLUSTER_PREFIX environment variable.
643+
644+
```bash
645+
CLUSTER_PREFIX=dbx-node-lambda bash ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh
646+
```
647+
648+
The URI of the cluster is available in the `atlas-expansions.yml` file.
649+
650+
#### Search Indexes
651+
652+
1. Set up an Atlas cluster, as outlined in the "Launching an Atlas Cluster" section.
653+
2. Add the URI of the cluster to the environment as the MONGODB_URI environment variable.
654+
3. Run the tests with `npm run check:search-indexes`.
655+
656+
#### Deployed Lambda Tests
657+
658+
TODO
659+
649660
### TODO Special Env Sections
650661
651662
- Kerberos
@@ -672,3 +683,41 @@ lerna run test --scope @mongosh/service-provider-server
672683
[npm-csfle]: https://www.npmjs.com/package/mongodb-client-encryption
673684
[atlas-api-key]: https://docs.atlas.mongodb.com/tutorial/configure-api-access/organization/create-one-api-key
674685
[scram-auth]: https://docs.atlas.mongodb.com/security-add-mongodb-users/#database-user-authentication
686+
687+
## Testing driver changes with mongosh
688+
689+
These steps require `mongosh` to be available locally. Clone it from GitHub.
690+
691+
`mongosh` uses a `lerna` monorepo. As a result, `mongosh` contains multiple references to the `mongodb` package
692+
in their `package.json`s.
693+
694+
Set up `mongosh` by following the steps in the `mongosh` readme.
695+
696+
### Point mongosh to the driver
697+
698+
mongosh contains a script that does this. To use the script, create an environment
699+
variable `REPLACE_PACKAGE` that contains a string in the form
700+
`mongodb:<path to your local instance of the driver>`. The package replacement script will replace
701+
all occurrences of `mongodb` with the local path of your driver.
702+
703+
An alternative, which can be useful for
704+
testing a release, is to first run `npm pack` on the driver. This generates a tarball containing all the code
705+
that would be uploaded to `npm` if it were released. Then, set the environment variable `REPLACE_PACKAGE`
706+
with the full path to the file.
707+
708+
Once the environment variable is set, run replace package in `mongosh` with:
709+
```sh
710+
npm run replace:package
711+
```
712+
713+
### Run specific package tests
714+
715+
`mongosh`'s readme documents how to run its tests. Most likely, it isn't necessary to run all of mongosh's
716+
tests. The `mongosh` readme also documents how to run tests for a particular scope. The scopes are
717+
listed in the `generate_mongosh_tasks.js` evergreen generation script.
718+
719+
For example, to run the `service-provider-server` package, run the following command in `mongosh`:
720+
721+
```shell
722+
lerna run test --scope @mongosh/service-provider-server
723+
```

0 commit comments

Comments
 (0)