From da6d7e1334648dc5ad1edbfa73f90f75d0e93f17 Mon Sep 17 00:00:00 2001 From: Aditi Khare Date: Wed, 15 Jan 2025 10:50:33 -0500 Subject: [PATCH] add separate setup npm command --- .github/workflows/encryption-tests.yml | 2 ++ CONTRIBUTING.md | 2 +- package.json | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/encryption-tests.yml b/.github/workflows/encryption-tests.yml index d4903209246..3c0fbc65b8a 100644 --- a/.github/workflows/encryption-tests.yml +++ b/.github/workflows/encryption-tests.yml @@ -33,5 +33,7 @@ jobs: run: npm install - name: Install mongodb-client-encryption run: npm install mongodb-client-encryption + - name: Setup Tests + run: npm run setup-test-encryption - name: Run Tests run: npm run test-encryption diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 18e99b6657b..6efea5d26e4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,7 +46,7 @@ If you have a question about Mongoose (not a bug report) please post it to eithe * execute `npm run test-tsd` to run the typescript tests * execute `npm run ts-benchmark` to run the typescript benchmark "performance test" for a single time. * 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. -* in order to run tests that require an cluster with encryption locally, run `npm run test-encryption`/ Alternatively, you can start an encrypted cluster using the `scripts/configure-cluster-with-encryption.sh` file. +* in order to run tests that require an cluster with encryption locally, run `npm run setup-test-encryption` followed by `npm run test-encryption`. Alternatively, you can start an encrypted cluster using the `scripts/configure-cluster-with-encryption.sh` file. * These scripts can take a few minutes to run. * To change an encryption configuration, it is recommended to follow these steps: * Edit the variables in `scripts/configure-cluster-with-encryption.sh` with your desired configuration. diff --git a/package.json b/package.json index cdf2556c7c0..d8a1d01c4a9 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "bson": "^6.7.0", "kareem": "2.6.3", "mongodb": "~6.10.0", + "mongodb-client-encryption": "^6.1.1", "mpath": "0.9.0", "mquery": "5.0.0", "ms": "2.1.3", @@ -104,7 +105,8 @@ "test-deno": "deno run --allow-env --allow-read --allow-net --allow-run --allow-sys --allow-write ./test/deno.js", "test-rs": "START_REPLICA_SET=1 mocha --timeout 30000 --exit ./test/*.test.js", "test-tsd": "node ./test/types/check-types-filename && tsd", - "test-encryption": "bash scripts/configure-cluster-with-encryption.sh && mocha --exit ./test/encryption/*.test.js && npm uninstall mongodb-client-encryption > /dev/null", + "setup-test-encryption": "bash scripts/configure-cluster-with-encryption.sh", + "test-encryption": "mocha --exit ./test/encryption/*.test.js", "tdd": "mocha ./test/*.test.js --inspect --watch --recursive --watch-files ./**/*.{js,ts}", "test-coverage": "nyc --reporter=html --reporter=text npm test", "ts-benchmark": "cd ./benchmarks/typescript/simple && npm install && npm run benchmark | node ../../../scripts/tsc-diagnostics-check"