Skip to content

Commit 8c75a58

Browse files
comments
- add testing docs for the smoke tests - smoke tests depend on a stable package filename, instead of a filename that includes the version
1 parent d9ed40c commit 8c75a58

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

.evergreen/run-resource-management-smoke-tests.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ echo "Building driver..."
66
npm pack
77
echo "Building driver...finished."
88

9+
PACKAGE_FILE=$(ls mongodb-*.tgz)
10+
11+
mv $PACKAGE_FILE mongodb-current.tgz
12+
913
echo "Node version: $(node -v)"
1014
cd test/explicit-resource-management
1115

test/explicit-resource-management/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dependencies": {
1515
"@types/chai": "^4.3.16",
1616
"chai": "^4.4.1",
17-
"mongodb": "../../mongodb-6.8.0.tgz",
17+
"mongodb": "../../mongodb-current.tgz",
1818
"tslib": "^2.6.3"
1919
},
2020
"devDependencies": {

test/readme.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Below is a summary of the types of test automation in this repo.
3232
| TypeScript Definition | `/test/types` | The TypeScript definition tests verify the type definitions are correct. | `npm run check:tsd` |
3333
| GitHub Actions | `/test/action` | Tests that run as GitHub Actions such as dependency checking. | Currently, only `npm run check:dependencies` but could be expanded to more in the future. |
3434
| Code Examples | `/test/integration/node-specific/examples` | Code examples that are also paired with tests that show they are working examples. | Currently, `npm run check:lambda` to test the AWS Lambda example with default auth and `npm run check:lambda:aws` to test the AWS Lambda example with AWS auth. |
35+
| Explicit Resource Management | `/test/integration/explicit-resource-management` | Tests that use explicit resource management with the drivers' disposable resources. | `bash .evergreen/run-resource-management-smoke-test.sh` |
3536

3637
### Spec Tests
3738

@@ -101,7 +102,7 @@ You can prefix `npm test` with a `MONGODB_URI` environment variable to point the
101102
MONGODB_URI=mongodb://localhost:27017 npm test
102103
```
103104

104-
For a replica set, you might use:
105+
For a replica set, you might use:
105106

106107
```sh
107108
MONGODB_URI=mongodb://localhost:31000,localhost:31001,localhost:31002/?replicaSet=rs npm test
@@ -115,14 +116,14 @@ The easiest way to run a single test is by appending `.only()` to the test conte
115116
it.only('cool test', function() {})
116117
```
117118

118-
Then, run the test using `npm run check:test` for a functional or integration test or
119+
Then, run the test using `npm run check:test` for a functional or integration test or
119120
`npm run check:unit`
120121
for a unit test. See [Mocha's documentation][mocha-only] for more detailed information on `.only()`.
121122

122123
Another way to run a single test is to use Mocha's `grep` flag. For functional or integration tests, run:
123124
```sh
124125
npm run check:test -- -g <test name>
125-
```
126+
```
126127
For unit tests, run:
127128
```sh
128129
npm run check:unit -- -g <test name>
@@ -133,7 +134,7 @@ See the [Mocha documentation][mocha-grep] for information on the `grep` flag.
133134

134135
[Evergreen][evergreen-wiki] is the continuous integration (CI) system we use. Evergreen builds are automatically run whenever a pull request is created or when commits are pushed to particular branches (e.g., `main`, `4.0`, and `3.6`).
135136

136-
Each Evergreen build runs the test suite against a variety of build variants that include a combination of topologies, special environments, and operating systems. By default, commits in pull requests only run a subset of the build variants in order to save time and resources. To configure a build, update `.evergreen/config.yml.in` and then generate a new Evergreen config via:
137+
Each Evergreen build runs the test suite against a variety of build variants that include a combination of topologies, special environments, and operating systems. By default, commits in pull requests only run a subset of the build variants in order to save time and resources. To configure a build, update `.evergreen/config.yml.in` and then generate a new Evergreen config via:
137138

138139
```sh
139140
node .evergreen/generate_evergreen_tasks.js
@@ -353,13 +354,13 @@ The following steps will walk you through how to start and test a load balancer.
353354

354355
Create two `mongos` running on ports `27017` and `27018`:
355356
```sh
356-
mongos --configdb test/localhost:27217 --bind_ip localhost --setParameter enableTestCommands=1 --setParameter loadBalancerPort=27050
357+
mongos --configdb test/localhost:27217 --bind_ip localhost --setParameter enableTestCommands=1 --setParameter loadBalancerPort=27050
357358
mongos --configdb test/localhost:27217 --port 27018 --bind_ip localhost --setParameter enableTestCommands=1 --setParameter loadBalancerPort=27051
358359
```
359360

360361
Initiate cluster on `mongos` in shell:
361362
```sh
362-
mongosh "mongodb://localhost:27017" --eval "sh.addShard('testing/localhost:27218,localhost:27219,localhost:27220')"
363+
mongosh "mongodb://localhost:27017" --eval "sh.addShard('testing/localhost:27218,localhost:27219,localhost:27220')"
363364
mongosh "mongodb://localhost:27017" --eval "sh.enableSharding('test')"
364365
```
365366
1. An alternative way to the fully manual cluster setup is to use `mlaunch`:
@@ -434,7 +435,7 @@ The following steps will walk you through how to run the tests for CSFLE.
434435
1. Install [MongoDB Client Encryption][npm-csfle] if you haven't already:
435436
```sh
436437
npm install mongodb-client-encryption
437-
```
438+
```
438439
> **Note:** if developing changes in `mongodb-client-encryption`,
439440
you can link it locally using `etc/tooling/fle.sh`.
440441

@@ -599,7 +600,7 @@ lerna run test --scope @mongosh/service-provider-server
599600
npm i --no-save mongodb-client-encryption
600601
```
601602
6. Launch a MongoDB server
602-
7. Run the full suite:
603+
7. Run the full suite:
603604
```sh
604605
npm run check:test
605606
```

0 commit comments

Comments
 (0)