Skip to content

Commit e1d467e

Browse files
committed
doc: add info about testing with different versions and the rosetta setup for Mac
1 parent 2bd2c3a commit e1d467e

1 file changed

Lines changed: 33 additions & 4 deletions

File tree

test/readme.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ about the types of tests and how to run them.
1010
- [About the Tests](#about-the-tests)
1111
- [Spec Tests](#spec-tests)
1212
- [Running the Tests Locally](#running-the-tests-locally)
13+
- [Testing Against Different Versions](#testing-against-different-versions)
14+
- ["Bad CPU type in executable" error](#bad-cpu-type-in-executable-error)
1315
- [Testing With Authorization-Enabled](#testing-with-authorization-enabled)
1416
- [Testing Different MongoDB Topologies](#testing-different-mongodb-topologies)
1517
- [Running Individual Tests](#running-individual-tests)
@@ -118,6 +120,33 @@ The output will show how many tests passed, failed, and are pending. Tests that
118120

119121
In the following subsections, we'll dig into the details of running the tests.
120122

123+
### Testing Against Different Versions
124+
125+
Sometimes you'll need to run tests against a specific version, such as "7.0", and to do that you can use the `VERSION` env var.
126+
127+
```sh
128+
VERSION=7.0 TOPOLOGY='replica_set' bash .evergreen/run-orchestration.sh
129+
```
130+
131+
Older versions of MongoDB may not have Mac binaries, so you may also need to specify a different architecture:
132+
133+
```sh
134+
VERSION=4.2 ARCH=x86_64 TOPOLOGY='replica_set' bash .evergreen/run-orchestration.sh
135+
```
136+
137+
#### "Bad CPU type in executable" error
138+
139+
You may encounter this error if Rosetta isn't properly configured on your system.
140+
```txt
141+
OSError: [Errno 86] Bad CPU type in executable: '.../node-mongodb-native/drivers-evergreen-tools/mongodb/bin/mongod'
142+
```
143+
144+
To fix it, simply run:
145+
146+
```sh
147+
softwareupdate --install-rosetta
148+
```
149+
121150
### Testing With Authorization-Enabled
122151

123152
By default, the integration tests run with auth-enabled and the mongo orchestration script will run with auth enabled when the `AUTH` variable is set to `auth`. Tests can be run locally without auth by setting the environment variable `AUTH` to the value of `noauth`. This must be a two-step process of starting a server without auth-enabled and then running the tests without auth-enabled.
@@ -505,7 +534,7 @@ The following steps will walk you through how to run the tests for CSFLE.
505534
```bash
506535
npm install mongodb-client-encryption
507536
```
508-
> [!NOTE]
537+
> [!NOTE]
509538
> If developing changes in `mongodb-client-encryption`, you can link it locally using `etc/tooling/fle.sh`.
510539
511540
2. Load FLE credentials and download crypt_shared
@@ -517,8 +546,8 @@ source .evergreen/setup-fle.sh
517546
```
518547
519548
> [!NOTE]
520-
> By default, `setup-fle.sh` installs crypt_shared. If you want to test with mongocryptd instead, set the RUN_WITH_MONGOCRYPTD environment variable before
521-
> sourcing `setup-fle.sh`.
549+
> By default, `setup-fle.sh` installs crypt_shared. If you want to test with mongocryptd instead, set the RUN_WITH_MONGOCRYPTD environment variable before
550+
> sourcing `setup-fle.sh`.
522551
523552
3. Run the functional tests:
524553
```bash
@@ -546,7 +575,7 @@ All of this is handled in the csfle/azurekms and csfle/gcpkms folders in drivers
546575
547576
#### Azure KMS
548577
549-
1. Provision an Azure server. You must set the `AZUREKMS_VMNAME_PREFIX` variable:
578+
1. Provision an Azure server. You must set the `AZUREKMS_VMNAME_PREFIX` variable:
550579
551580
```bash
552581
export AZUREKMS_VMNAME_PREFIX: "NODE_DRIVER"

0 commit comments

Comments
 (0)