Skip to content

Commit 5102661

Browse files
finish revert
1 parent f538115 commit 5102661

File tree

3 files changed

+45
-69
lines changed

3 files changed

+45
-69
lines changed

.evergreen/config.in.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1652,9 +1652,9 @@ task_groups:
16521652
params:
16531653
working_dir: src
16541654
binary: bash
1655+
add_expansions_to_env: true
16551656
env:
16561657
MONGODB_VERSION: "7.0"
1657-
CLUSTER_PREFIX: dbx-node-search-indexes
16581658
args:
16591659
- ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh
16601660
- command: expansions.update
@@ -1665,6 +1665,7 @@ task_groups:
16651665
params:
16661666
working_dir: src
16671667
binary: bash
1668+
add_expansions_to_env: true
16681669
args:
16691670
- ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
16701671
setup_group_can_fail_task: true

.evergreen/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4678,9 +4678,9 @@ task_groups:
46784678
params:
46794679
working_dir: src
46804680
binary: bash
4681+
add_expansions_to_env: true
46814682
env:
46824683
MONGODB_VERSION: '7.0'
4683-
CLUSTER_PREFIX: dbx-node-search-indexes
46844684
args:
46854685
- ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh
46864686
- command: expansions.update
@@ -4691,6 +4691,7 @@ task_groups:
46914691
params:
46924692
working_dir: src
46934693
binary: bash
4694+
add_expansions_to_env: true
46944695
args:
46954696
- ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
46964697
setup_group_can_fail_task: true

test/readme.md

Lines changed: 41 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,14 @@ about the types of tests and how to run them.
3030
- [Serverless](#serverless)
3131
- [Load Balanced](#load-balanced)
3232
- [Client-Side Field-Level Encryption (CSFLE)](#client-side-field-level-encryption-csfle)
33+
- [Testing driver changes with mongosh](#testing-driver-changes-with-mongosh)
34+
- [Point mongosh to the driver](#point-mongosh-to-the-driver)
35+
- [Run specific package tests](#run-specific-package-tests)
3336
- [KMIP FLE support tests](#kmip-fle-support-tests)
3437
- [Deployed KMS Tests](#deployed-kms-tests)
3538
- [Azure KMS](#azure-kms)
3639
- [GCP KMS](#gcp-kms)
37-
- [Deployed Atlas Tests](#deployed-atlas-tests)
38-
- [Launching an Atlas Cluster](#launching-an-atlas-cluster)
39-
- [Search Indexes](#search-indexes)
40-
- [Deployed Lambda Tests](#deployed-lambda-tests)
4140
- [TODO Special Env Sections](#todo-special-env-sections)
42-
- [Testing driver changes with mongosh](#testing-driver-changes-with-mongosh)
43-
- [Point mongosh to the driver](#point-mongosh-to-the-driver)
44-
- [Run specific package tests](#run-specific-package-tests)
4541

4642
## About the Tests
4743

@@ -615,6 +611,44 @@ The following steps will walk you through how to run the tests for CSFLE.
615611

616612
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`.
617613

614+
#### Testing driver changes with mongosh
615+
616+
These steps require `mongosh` to be available locally. Clone it from GitHub.
617+
618+
`mongosh` uses a `lerna` monorepo. As a result, `mongosh` contains multiple references to the `mongodb` package
619+
in their `package.json`s.
620+
621+
Set up `mongosh` by following the steps in the `mongosh` readme.
622+
623+
##### Point mongosh to the driver
624+
625+
mongosh contains a script that does this. To use the script, create an environment
626+
variable `REPLACE_PACKAGE` that contains a string in the form
627+
`mongodb:<path to your local instance of the driver>`. The package replacement script will replace
628+
all occurrences of `mongodb` with the local path of your driver.
629+
630+
An alternative, which can be useful for
631+
testing a release, is to first run `npm pack` on the driver. This generates a tarball containing all the code
632+
that would be uploaded to `npm` if it were released. Then, set the environment variable `REPLACE_PACKAGE`
633+
with the full path to the file.
634+
635+
Once the environment variable is set, run replace package in `mongosh` with:
636+
```sh
637+
npm run replace:package
638+
```
639+
640+
##### Run specific package tests
641+
642+
`mongosh`'s readme documents how to run its tests. Most likely, it isn't necessary to run all of mongosh's
643+
tests. The `mongosh` readme also documents how to run tests for a particular scope. The scopes are
644+
listed in the `generate_mongosh_tasks.js` evergreen generation script.
645+
646+
For example, to run the `service-provider-server` package, run the following command in `mongosh`:
647+
648+
```shell
649+
lerna run test --scope @mongosh/service-provider-server
650+
```
651+
618652
#### KMIP FLE support tests
619653

620654
1. Install `virtualenv`:
@@ -712,28 +746,6 @@ source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh
712746
bash .evergreen/run-deployed-gcp-kms-tests.sh
713747
```
714748

715-
### Deployed Atlas Tests
716-
717-
#### Launching an Atlas Cluster
718-
719-
Using drivers evergreen tools, run the `setup-atlas-cluster` script. You must also set the CLUSTER_PREFIX environment variable.
720-
721-
```bash
722-
CLUSTER_PREFIX=dbx-node-lambda bash ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh
723-
```
724-
725-
The URI of the cluster is available in the `atlas-expansions.yml` file.
726-
727-
#### Search Indexes
728-
729-
1. Set up an Atlas cluster, as outlined in the "Launching an Atlas Cluster" section.
730-
2. Add the URI of the cluster to the environment as the MONGODB_URI environment variable.
731-
3. Run the tests with `npm run check:search-indexes`.
732-
733-
#### Deployed Lambda Tests
734-
735-
TODO
736-
737749
### TODO Special Env Sections
738750

739751
- Kerberos
@@ -760,41 +772,3 @@ TODO
760772
[npm-csfle]: https://www.npmjs.com/package/mongodb-client-encryption
761773
[atlas-api-key]: https://docs.atlas.mongodb.com/tutorial/configure-api-access/organization/create-one-api-key
762774
[scram-auth]: https://docs.atlas.mongodb.com/security-add-mongodb-users/#database-user-authentication
763-
764-
## Testing driver changes with mongosh
765-
766-
These steps require `mongosh` to be available locally. Clone it from GitHub.
767-
768-
`mongosh` uses a `lerna` monorepo. As a result, `mongosh` contains multiple references to the `mongodb` package
769-
in their `package.json`s.
770-
771-
Set up `mongosh` by following the steps in the `mongosh` readme.
772-
773-
### Point mongosh to the driver
774-
775-
mongosh contains a script that does this. To use the script, create an environment
776-
variable `REPLACE_PACKAGE` that contains a string in the form
777-
`mongodb:<path to your local instance of the driver>`. The package replacement script will replace
778-
all occurrences of `mongodb` with the local path of your driver.
779-
780-
An alternative, which can be useful for
781-
testing a release, is to first run `npm pack` on the driver. This generates a tarball containing all the code
782-
that would be uploaded to `npm` if it were released. Then, set the environment variable `REPLACE_PACKAGE`
783-
with the full path to the file.
784-
785-
Once the environment variable is set, run replace package in `mongosh` with:
786-
```sh
787-
npm run replace:package
788-
```
789-
790-
### Run specific package tests
791-
792-
`mongosh`'s readme documents how to run its tests. Most likely, it isn't necessary to run all of mongosh's
793-
tests. The `mongosh` readme also documents how to run tests for a particular scope. The scopes are
794-
listed in the `generate_mongosh_tasks.js` evergreen generation script.
795-
796-
For example, to run the `service-provider-server` package, run the following command in `mongosh`:
797-
798-
```shell
799-
lerna run test --scope @mongosh/service-provider-server
800-
```

0 commit comments

Comments
 (0)