You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[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)
33
36
-[KMIP FLE support tests](#kmip-fle-support-tests)
34
37
-[Deployed KMS Tests](#deployed-kms-tests)
35
38
-[Azure KMS](#azure-kms)
36
39
-[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)
41
40
-[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)
45
41
46
42
## About the Tests
47
43
@@ -615,6 +611,44 @@ The following steps will walk you through how to run the tests for CSFLE.
615
611
616
612
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`.
617
613
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
0 commit comments