Skip to content

Commit f89a1a3

Browse files
authored
Merge branch 'main' into NODE-6245
2 parents 61e2e41 + c5bed5e commit f89a1a3

14 files changed

+51
-63
lines changed

.evergreen/docker/Dockerfile.musl

-7
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,3 @@ git --version
1212
c++ --version
1313
g++ --version
1414
EOF
15-
16-
# clone drivers evergreen tools into the same location that it lives on the host machine
17-
# this ensures any paths configured in variables by drivers-evergreen-tools work
18-
# in the container too.
19-
ARG DRIVERS_TOOLS=drivers-evergreen-tools
20-
WORKDIR ${DRIVERS_TOOLS}
21-
RUN git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git .

.evergreen/prepare-mongodb-aws-ecs-auth.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ cat $ECS_SRC_DIR/.evergreen/run-mongodb-aws-ecs-test.sh
2121

2222
# tar the file and drivers tools and do the same
2323
cd ..
24-
tar -czf src.tgz src drivers-tools
24+
tar -czf src.tgz src
2525
mv src.tgz $ECS_SRC_DIR/src.tgz
2626

2727
export MONGODB_BINARIES="${MONGODB_BINARIES}"

.evergreen/prepare-shell.sh

+7-8
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66

77
# This script prepares a shell to run the remaining scripts in this folder
88
# It MUST be kept idempotent! It will overwrite the orchestration config and expansion.yml file upon every run
9-
# and it will only clone drivers-tools if they do not exist one directory above our driver src
109

1110
PROJECT_DIRECTORY="$(pwd)"
12-
DRIVERS_TOOLS=$(cd .. && echo "$(pwd)/drivers-tools")
11+
DRIVERS_TOOLS="$(pwd)/drivers-evergreen-tools"
1312
MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration"
1413
MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin"
1514
UPLOAD_BUCKET="${project}"
@@ -30,12 +29,12 @@ export MONGODB_BINARIES
3029
export TMPDIR="$MONGO_ORCHESTRATION_HOME/db"
3130
export PATH="$MONGODB_BINARIES:$PATH"
3231

33-
if [ ! -d "$DRIVERS_TOOLS" ]; then
34-
# Only clone driver tools if it does not exist
35-
git clone --depth=1 "https://github.com/mongodb-labs/drivers-evergreen-tools.git" "${DRIVERS_TOOLS}"
36-
fi
37-
38-
echo "installed DRIVERS_TOOLS from commit $(git -C "${DRIVERS_TOOLS}" rev-parse HEAD)"
32+
# Note the evergreen option on git.get_project recurse_submodules does not work, so do it here.
33+
# We ignore errors in case we are running in a container where git doesn't trust the tmp directory.
34+
set +e
35+
git submodule init
36+
git submodule update
37+
set -e
3938

4039
cat <<EOT > "$MONGO_ORCHESTRATION_HOME/orchestration.config"
4140
{

.evergreen/run-alpine-fle-tests.sh

+5
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,10 @@ set -o xtrace
99
export npm_config_cache=$(pwd)/.cache
1010
npm install
1111

12+
# Fix to point at the drivers tools pems installed in src.
13+
export CSFLE_TLS_CA_FILE=$(pwd)/drivers-evergreen-tools/.evergreen/x509gen/ca.pem
14+
export CSFLE_TLS_CERT_FILE=$(pwd)/drivers-evergreen-tools/.evergreen/x509gen/server.pem
15+
export CSFLE_TLS_CLIENT_CERT_FILE=$(pwd)/drivers-evergreen-tools/.evergreen/x509gen/client.pem
16+
1217
ALPINE=true \
1318
npm run check:csfle

.evergreen/run-deployed-azure-kms-tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export AZUREKMS_PUBLICKEYPATH=/tmp/testazurekms_publickey
1111
export AZUREKMS_PRIVATEKEYPATH=/tmp/testazurekms_privatekey
1212

1313
echo "compressing node driver source and tools ... begin"
14-
tar -czf node-driver-source.tgz src drivers-tools
14+
tar -czf node-driver-source.tgz src
1515
echo "compressing node driver source and tools ... end"
1616

1717
export AZUREKMS_SRC=node-driver-source.tgz

.evergreen/run-mongodb-aws-ecs-test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -o errexit # Exit the script with error if any of the commands fail
55
export MONGODB_URI="$1"
66

77
tar -xzf src/src.tgz
8-
# produces src/ and drivers-tools/
8+
# produces src/
99

1010
cd src
1111

.evergreen/run-oidc-tests-azure.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -o errexit # Exit the script with error if any of the commands fail
44

55
export AZUREOIDC_DRIVERS_TAR_FILE=/tmp/node-mongodb-native.tgz
66
cd ..
7-
tar -czf $AZUREOIDC_DRIVERS_TAR_FILE src drivers-tools
7+
tar -czf $AZUREOIDC_DRIVERS_TAR_FILE src
88
cd -
99
export AZUREOIDC_TEST_CMD="source ./env.sh && cd src && ENVIRONMENT=azure ./.evergreen/${SCRIPT}"
1010
export PROJECT_DIRECTORY=$PROJECT_DIRECTORY

.evergreen/run-oidc-tests-gcp.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -o errexit # Exit the script with error if any of the commands fail
44

55
export GCPOIDC_DRIVERS_TAR_FILE=/tmp/node-mongodb-native.tgz
66
cd ..
7-
tar -czf $GCPOIDC_DRIVERS_TAR_FILE src drivers-tools
7+
tar -czf $GCPOIDC_DRIVERS_TAR_FILE src
88
cd -
99
export GCPOIDC_TEST_CMD="source ./secrets-export.sh drivers/gcpoidc && cd src && ENVIRONMENT=gcp ./.evergreen/${SCRIPT}"
1010
export PROJECT_DIRECTORY=$PROJECT_DIRECTORY

.evergreen/run-oidc-tests-k8s.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -o errexit # Exit the script with error if any of the commands fail
44

55
export K8S_DRIVERS_TAR_FILE=/tmp/node-mongodb-native.tgz
66
cd ..
7-
tar -czf $K8S_DRIVERS_TAR_FILE src drivers-tools
7+
tar -czf $K8S_DRIVERS_TAR_FILE src
88
cd -
99
bash $DRIVERS_TOOLS/.evergreen/auth_oidc/k8s/setup-pod.sh
1010
bash $DRIVERS_TOOLS/.evergreen/auth_oidc/k8s/run-self-test.sh

.github/dependabot.yml

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
version: 2
77
updates:
8+
- package-ecosystem: "gitsubmodule" # See documentation for possible values
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
812
- package-ecosystem: "github-actions" # See documentation for possible values
913
directory: "/" # Location of package manifests
1014
schedule:

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "drivers-evergreen-tools"]
2+
path = drivers-evergreen-tools
3+
url = https://github.com/mongodb-labs/drivers-evergreen-tools.git

drivers-evergreen-tools

Submodule drivers-evergreen-tools added at cec0139

test/readme.md

+25-14
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,17 @@ The actual implementations of the spec tests can be unit tests or integration te
7878

7979
The easiest way to get started running the tests locally is to start a standalone server and run all of the tests.
8080

81-
Start a `mongod` standalone with our [cluster_setup.sh](tools/cluster_setup.sh) script:
81+
Ensure the drivers tools submodule is cloned:
8282

8383
```sh
84-
./test/tools/cluster_setup.sh server
84+
git submodule init
85+
git submodule update
86+
```
87+
88+
Start a `mongod` standalone with our [run-orchestration.sh](.evergreen/run-orchestration.sh) script with the environment set for the cluster:
89+
90+
```sh
91+
VERSION='latest' TOPOLOGY='server' AUTH='noauth' ./.evergreen/run-orchestration.sh
8592
```
8693

8794
Then run the tests:
@@ -98,11 +105,10 @@ In the following subsections, we'll dig into the details of running the tests.
98105

99106
### Testing With Authorization-Enabled
100107

101-
By default, the integration tests run with auth-enabled and the `cluster_setup.sh` script defaults to starting servers with auth-enabled. Tests can be run locally without auth by setting the environment
102-
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.
108+
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.
103109

104110
```shell
105-
AUTH='noauth' ./test/tools/cluster_setup.sh <server>
111+
AUTH='noauth' TOPOLOGY='server' ./.evergreen/run-orchestration.sh
106112
AUTH='noauth' npm run check:test
107113
```
108114
### Testing Different MongoDB Topologies
@@ -112,21 +118,21 @@ As we mentioned earlier, the tests check the topology of the MongoDB server bein
112118
In the steps above, we started a standalone server:
113119

114120
```sh
115-
./test/tools/cluster_setup.sh server
121+
TOPOLOGY='server' ./.evergreen/run-orchestration.sh
116122
```
117123

118-
You can use the same [cluster_setup.sh](tools/cluster_setup.sh) script to start a replica set or sharded cluster by passing the appropriate option:
124+
You can use the same [run-orchestration.sh](.evergreen/run-orchestration.sh) script to start a replica set or sharded cluster by passing the appropriate option:
119125
```sh
120-
./test/tools/cluster_setup.sh replica_set
126+
TOPOLOGY='replica_set' ./.evergreen/run-orchestration.sh
121127
```
122128
or
123129
```sh
124-
./test/tools/cluster_setup.sh sharded_cluster
130+
TOPOLOGY='sharded_cluster' ./.evergreen/run-orchestration.sh
125131
```
126132
If you are running more than a standalone server, make sure your `ulimit` settings are in accordance with [MongoDB's recommendations][mongodb-ulimit]. Changing the settings on the latest versions of macOS can be tricky. See [this article][macos-ulimt] for tips. (You likely don't need to do the complicated `maxproc` steps.)
127133

128-
The [cluster_setup.sh](tools/cluster_setup.sh) script automatically stores the files associated with the MongoDB server in the `data` directory, which is stored at the top-level of this repository.
129-
You can delete this directory if you want to ensure you're running a clean configuration. If you delete the directory, the associated database server will be stopped, and you will need to run [cluster_setup.sh](tools/cluster_setup.sh) again.
134+
The [run-orchestration.sh](.evergreen/run-orchestration.sh) script automatically stores the files associated with the MongoDB server in the `data` directory, which is stored at the top-level of this repository.
135+
You can delete this directory if you want to ensure you're running a clean configuration. If you delete the directory, the associated database server will be stopped, and you will need to run [run-orchestration.sh](.evergreen/run-orchestration.sh) again.
130136

131137
You can prefix `npm test` with a `MONGODB_URI` environment variable to point the tests to a specific deployment. For example, for a standalone server, you might use:
132138

@@ -360,12 +366,17 @@ In order to test some features, you will need to generate and set a specialized
360366

361367
We recommend using a different terminal for each specialized environment to avoid the environment variables from one specialized environment impacting the test runs for another specialized environment.
362368

363-
Before you begin any of the subsections below, clone the [drivers-evergreen-tools repo](https://github.com/mongodb-labs/drivers-evergreen-tools.git).
369+
Before you begin any of the subsections below, ensure the drivers-evergreen-tools submodule is updated:
370+
371+
```sh
372+
git submodule init
373+
git submodule update
374+
```
364375

365-
We recommend creating an environment variable named `DRIVERS_TOOLS` that stores the path to your local copy of the `driver-evergreen-tools` repo (code examples in this section will assume this has been done):
376+
We recommend creating an environment variable named `DRIVERS_TOOLS` that stores the path to the `driver-evergreen-tools` submodule (code examples in this section will assume this has been done):
366377

367378
```sh
368-
export DRIVERS_TOOLS="/path/to/your/copy/of/drivers-evergreen-tools"
379+
export DRIVERS_TOOLS="./drivers-evergreen-tools"
369380
```
370381

371382
### Serverless

test/tools/cluster_setup.sh

-28
This file was deleted.

0 commit comments

Comments
 (0)