Skip to content

Commit f38366b

Browse files
change to two files for local testing
1 parent eac708f commit f38366b

File tree

5 files changed

+33
-28
lines changed

5 files changed

+33
-28
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ examples/ecommerce-netlify-functions/.netlify/state.json
6868
notes.md
6969
list.out
7070

71-
encrypted-cluster
71+
encrypted-cluster

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ If you have a question about Mongoose (not a bug report) please post it to eithe
4646
* execute `npm run test-tsd` to run the typescript tests
4747
* execute `npm run ts-benchmark` to run the typescript benchmark "performance test" for a single time.
4848
* execute `npm run ts-benchmark-watch` to run the typescript benchmark "performance test" while watching changes on types folder. Note: Make sure to commit all changes before executing this command.
49-
* in order to run tests that require an encrypted cluster locally, run `npm run test-encryption-local`. Alternatively, you can start an encrypted cluster using the `scripts/encrypted-cluster.sh` file
49+
* in order to run tests that require an encrypted cluster locally, run `npm run test-encryption-local`. Alternatively, you can start an encrypted cluster using the `scripts/start-encrypted-cluster.sh` file
5050

5151
## Documentation
5252

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"test-rs": "START_REPLICA_SET=1 mocha --timeout 30000 --exit ./test/*.test.js",
108108
"test-tsd": "node ./test/types/check-types-filename && tsd",
109109
"test-encryption": "mocha --exit ./test/encryption/*.test.js",
110-
"test-encryption-local": "chmod +x scripts/encrypted-cluster.sh && scripts/encrypted-cluster.sh",
110+
"test-encryption-local": "chmod +x scripts/run-encryption-tests-local.sh && scripts/run-encryption-tests-local.sh",
111111
"tdd": "mocha ./test/*.test.js --inspect --watch --recursive --watch-files ./**/*.{js,ts}",
112112
"test-coverage": "nyc --reporter=html --reporter=text npm test",
113113
"ts-benchmark": "cd ./benchmarks/typescript/simple && npm install && npm run benchmark | node ../../../scripts/tsc-diagnostics-check"

scripts/encrypted-cluster.sh renamed to scripts/run-encryption-tests-local.sh

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,12 @@
22

33
# sets up an encrypted mongodb cluster
44

5+
export CWD=$(pwd);
6+
57
if [ -d "encrypted-cluster" ]; then
68
cd encrypted-cluster
79
else
8-
mkdir encrypted-cluster
9-
cd encrypted-cluster
10-
11-
if [-d drivers-evergreen-tools]; then
12-
git clone --depth=1 "https://github.com/mongodb-labs/drivers-evergreen-tools.git"
13-
fi
14-
15-
export DRIVERS_TOOLS=$(pwd)/drivers-evergreen-tools
16-
export MONGODB_VERSION=8.0
17-
export AUTH=true
18-
export MONGODB_BINARIES=$DRIVERS_TOOLS/mongodb/bin
19-
export NODE_DRIVER=~/dev/node-mongodb-native
20-
export MONGO_ORCHESTRATION_HOME=$DRIVERS_TOOLS/mo
21-
export PROJECT_ORCHESTRATION_HOME=$DRIVERS_TOOLS/.evergreen/orchestration
22-
export TOPOLOGY=sharded_cluster
23-
export SSL=nossl
24-
25-
cd $DRIVERS_TOOLS
26-
rm -rf mongosh mongodb mo
27-
mkdir mo
28-
cd -
29-
30-
rm expansions.sh 2> /dev/null
31-
32-
bash $DRIVERS_TOOLS/.evergreen/run-orchestration.sh
10+
source $CWD/scripts/start-encrypted-cluster.sh
3311
fi
3412

3513
# IMPORTANT: extracts mongodb-uri, and starts the cluster of servers, store the uri for GitHub output

scripts/start-encrypted-cluster.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
export CWD=$(pwd);
3+
mkdir encrypted-cluster
4+
cd encrypted-cluster
5+
6+
if [ ! -d "drivers-evergreen-tools/" ]; then
7+
git clone --depth=1 "https://github.com/mongodb-labs/drivers-evergreen-tools.git"
8+
fi
9+
10+
export DRIVERS_TOOLS=$CWD/encrypted-cluster/drivers-evergreen-tools
11+
export MONGODB_VERSION=8.0
12+
export AUTH=true
13+
export MONGODB_BINARIES=$DRIVERS_TOOLS/mongodb/bin
14+
export NODE_DRIVER=~/dev/node-mongodb-native
15+
export MONGO_ORCHESTRATION_HOME=$DRIVERS_TOOLS/mo
16+
export PROJECT_ORCHESTRATION_HOME=$DRIVERS_TOOLS/.evergreen/orchestration
17+
export TOPOLOGY=sharded_cluster
18+
export SSL=nossl
19+
20+
cd $DRIVERS_TOOLS
21+
rm -rf mongosh mongodb mo
22+
mkdir mo
23+
cd -
24+
25+
rm expansions.sh 2> /dev/null
26+
27+
bash $DRIVERS_TOOLS/.evergreen/run-orchestration.sh

0 commit comments

Comments
 (0)