Skip to content

Commit 9a6684d

Browse files
finish revert
1 parent a964150 commit 9a6684d

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
@@ -1630,9 +1630,9 @@ task_groups:
16301630
params:
16311631
working_dir: src
16321632
binary: bash
1633+
add_expansions_to_env: true
16331634
env:
16341635
MONGODB_VERSION: "7.0"
1635-
CLUSTER_PREFIX: dbx-node-search-indexes
16361636
args:
16371637
- ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh
16381638
- command: expansions.update
@@ -1643,6 +1643,7 @@ task_groups:
16431643
params:
16441644
working_dir: src
16451645
binary: bash
1646+
add_expansions_to_env: true
16461647
args:
16471648
- ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
16481649
setup_group_can_fail_task: true

.evergreen/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4654,9 +4654,9 @@ task_groups:
46544654
params:
46554655
working_dir: src
46564656
binary: bash
4657+
add_expansions_to_env: true
46574658
env:
46584659
MONGODB_VERSION: '7.0'
4659-
CLUSTER_PREFIX: dbx-node-search-indexes
46604660
args:
46614661
- ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh
46624662
- command: expansions.update
@@ -4667,6 +4667,7 @@ task_groups:
46674667
params:
46684668
working_dir: src
46694669
binary: bash
4670+
add_expansions_to_env: true
46704671
args:
46714672
- ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
46724673
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

@@ -598,6 +594,44 @@ The following steps will walk you through how to run the tests for CSFLE.
598594
599595
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`.
600596
597+
#### Testing driver changes with mongosh
598+
599+
These steps require `mongosh` to be available locally. Clone it from GitHub.
600+
601+
`mongosh` uses a `lerna` monorepo. As a result, `mongosh` contains multiple references to the `mongodb` package
602+
in their `package.json`s.
603+
604+
Set up `mongosh` by following the steps in the `mongosh` readme.
605+
606+
##### Point mongosh to the driver
607+
608+
mongosh contains a script that does this. To use the script, create an environment
609+
variable `REPLACE_PACKAGE` that contains a string in the form
610+
`mongodb:<path to your local instance of the driver>`. The package replacement script will replace
611+
all occurrences of `mongodb` with the local path of your driver.
612+
613+
An alternative, which can be useful for
614+
testing a release, is to first run `npm pack` on the driver. This generates a tarball containing all the code
615+
that would be uploaded to `npm` if it were released. Then, set the environment variable `REPLACE_PACKAGE`
616+
with the full path to the file.
617+
618+
Once the environment variable is set, run replace package in `mongosh` with:
619+
```sh
620+
npm run replace:package
621+
```
622+
623+
##### Run specific package tests
624+
625+
`mongosh`'s readme documents how to run its tests. Most likely, it isn't necessary to run all of mongosh's
626+
tests. The `mongosh` readme also documents how to run tests for a particular scope. The scopes are
627+
listed in the `generate_mongosh_tasks.js` evergreen generation script.
628+
629+
For example, to run the `service-provider-server` package, run the following command in `mongosh`:
630+
631+
```shell
632+
lerna run test --scope @mongosh/service-provider-server
633+
```
634+
601635
#### KMIP FLE support tests
602636
603637
1. Install `virtualenv`:
@@ -695,28 +729,6 @@ source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh
695729
bash .evergreen/run-deployed-gcp-kms-tests.sh
696730
```
697731
698-
### Deployed Atlas Tests
699-
700-
#### Launching an Atlas Cluster
701-
702-
Using drivers evergreen tools, run the `setup-atlas-cluster` script. You must also set the CLUSTER_PREFIX environment variable.
703-
704-
```bash
705-
CLUSTER_PREFIX=dbx-node-lambda bash ${DRIVERS_TOOLS}/.evergreen/atlas/setup-atlas-cluster.sh
706-
```
707-
708-
The URI of the cluster is available in the `atlas-expansions.yml` file.
709-
710-
#### Search Indexes
711-
712-
1. Set up an Atlas cluster, as outlined in the "Launching an Atlas Cluster" section.
713-
2. Add the URI of the cluster to the environment as the MONGODB_URI environment variable.
714-
3. Run the tests with `npm run check:search-indexes`.
715-
716-
#### Deployed Lambda Tests
717-
718-
TODO
719-
720732
### TODO Special Env Sections
721733
722734
- Kerberos
@@ -743,41 +755,3 @@ TODO
743755
[npm-csfle]: https://www.npmjs.com/package/mongodb-client-encryption
744756
[atlas-api-key]: https://docs.atlas.mongodb.com/tutorial/configure-api-access/organization/create-one-api-key
745757
[scram-auth]: https://docs.atlas.mongodb.com/security-add-mongodb-users/#database-user-authentication
746-
747-
## Testing driver changes with mongosh
748-
749-
These steps require `mongosh` to be available locally. Clone it from GitHub.
750-
751-
`mongosh` uses a `lerna` monorepo. As a result, `mongosh` contains multiple references to the `mongodb` package
752-
in their `package.json`s.
753-
754-
Set up `mongosh` by following the steps in the `mongosh` readme.
755-
756-
### Point mongosh to the driver
757-
758-
mongosh contains a script that does this. To use the script, create an environment
759-
variable `REPLACE_PACKAGE` that contains a string in the form
760-
`mongodb:<path to your local instance of the driver>`. The package replacement script will replace
761-
all occurrences of `mongodb` with the local path of your driver.
762-
763-
An alternative, which can be useful for
764-
testing a release, is to first run `npm pack` on the driver. This generates a tarball containing all the code
765-
that would be uploaded to `npm` if it were released. Then, set the environment variable `REPLACE_PACKAGE`
766-
with the full path to the file.
767-
768-
Once the environment variable is set, run replace package in `mongosh` with:
769-
```sh
770-
npm run replace:package
771-
```
772-
773-
### Run specific package tests
774-
775-
`mongosh`'s readme documents how to run its tests. Most likely, it isn't necessary to run all of mongosh's
776-
tests. The `mongosh` readme also documents how to run tests for a particular scope. The scopes are
777-
listed in the `generate_mongosh_tasks.js` evergreen generation script.
778-
779-
For example, to run the `service-provider-server` package, run the following command in `mongosh`:
780-
781-
```shell
782-
lerna run test --scope @mongosh/service-provider-server
783-
```

0 commit comments

Comments
 (0)