From 412829f30f05c2c8b31d07b1a59d59e663359345 Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Tue, 30 Jul 2024 16:02:22 -0600 Subject: [PATCH] comments pt 3 --- .evergreen/config.in.yml | 2 +- .evergreen/config.yml | 2 +- ....sh => run-resource-management-feature-integration.sh} | 0 test/explicit-resource-management/main.test.ts | 4 +--- test/explicit-resource-management/package.json | 4 +--- test/manual/resource_management.test.ts | 8 ++++---- test/readme.md | 2 +- 7 files changed, 9 insertions(+), 13 deletions(-) rename .evergreen/{run-resource-management-smoke-tests.sh => run-resource-management-feature-integration.sh} (100%) diff --git a/.evergreen/config.in.yml b/.evergreen/config.in.yml index aa0f4fd5ab..85c963ad7a 100644 --- a/.evergreen/config.in.yml +++ b/.evergreen/config.in.yml @@ -376,7 +376,7 @@ functions: MONGODB_URI: ${MONGODB_URI} binary: bash args: - - "${PROJECT_DIRECTORY}/.evergreen/run-resource-management-smoke-tests.sh" + - "${PROJECT_DIRECTORY}/.evergreen/run-resource-management-feature-integration.sh" "compile driver": - command: subprocess.exec diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 310ff753e1..570435d3e2 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -338,7 +338,7 @@ functions: MONGODB_URI: ${MONGODB_URI} binary: bash args: - - ${PROJECT_DIRECTORY}/.evergreen/run-resource-management-smoke-tests.sh + - ${PROJECT_DIRECTORY}/.evergreen/run-resource-management-feature-integration.sh compile driver: - command: subprocess.exec type: test diff --git a/.evergreen/run-resource-management-smoke-tests.sh b/.evergreen/run-resource-management-feature-integration.sh similarity index 100% rename from .evergreen/run-resource-management-smoke-tests.sh rename to .evergreen/run-resource-management-feature-integration.sh diff --git a/test/explicit-resource-management/main.test.ts b/test/explicit-resource-management/main.test.ts index e65738a375..5094671c67 100644 --- a/test/explicit-resource-management/main.test.ts +++ b/test/explicit-resource-management/main.test.ts @@ -14,7 +14,7 @@ async function setUpCollection(client: MongoClient) { return collection; } -describe('explicit resource management smoke tests', function () { +describe('explicit resource management feature integration tests', function () { describe('MongoClient', function () { it('does not crash or error when used with await-using syntax', async function () { await using client = new MongoClient(process.env.MONGODB_URI!); @@ -31,8 +31,6 @@ describe('explicit resource management smoke tests', function () { await using cursor = collection.find(); await cursor.next(); - await cursor.next(); - await cursor.next(); }) describe('cursor streams', function() { diff --git a/test/explicit-resource-management/package.json b/test/explicit-resource-management/package.json index 659c855744..adc23fb310 100644 --- a/test/explicit-resource-management/package.json +++ b/test/explicit-resource-management/package.json @@ -15,9 +15,7 @@ "@types/chai": "^4.3.16", "chai": "^4.4.1", "mongodb": "../../mongodb-current.tgz", - "tslib": "^2.6.3" - }, - "devDependencies": { + "tslib": "^2.6.3", "mocha": "^10.7.0", "typescript": "5.5" } diff --git a/test/manual/resource_management.test.ts b/test/manual/resource_management.test.ts index 1681838385..d92315ba3b 100644 --- a/test/manual/resource_management.test.ts +++ b/test/manual/resource_management.test.ts @@ -19,7 +19,7 @@ describe('Symbol.asyncDispose implementation tests', function () { }); describe('MongoClient', function () { - it('closes the the client', async function () { + it('the Symbol.asyncDispose method calls close()', async function () { client = new MongoClient('mongodb://localhost:27017'); const spy = sinon.spy(client, 'close'); @@ -29,7 +29,7 @@ describe('Symbol.asyncDispose implementation tests', function () { }); describe('ClientSession', function () { - it('ends the session', async function () { + it('the Symbol.asyncDispose method calls endSession()', async function () { client = new MongoClient('mongodb://localhost:27017'); const session = client.startSession(); @@ -40,7 +40,7 @@ describe('Symbol.asyncDispose implementation tests', function () { }); describe('ChangeStreams', function () { - it('closes the change stream', async function () { + it('the Symbol.asyncDispose method calls close()', async function () { client = new MongoClient('mongodb://localhost:27017'); const changeStream = client.watch(); @@ -51,7 +51,7 @@ describe('Symbol.asyncDispose implementation tests', function () { }); describe('cursors', function () { - it('closes the cursor', async function () { + it('the Symbol.asyncDispose method calls close()', async function () { client = new MongoClient('mongodb://localhost:27017'); const cursor = client.db('foo').collection('bar').find(); diff --git a/test/readme.md b/test/readme.md index d07bfafa1c..34ce8373e3 100644 --- a/test/readme.md +++ b/test/readme.md @@ -32,7 +32,7 @@ Below is a summary of the types of test automation in this repo. | TypeScript Definition | `/test/types` | The TypeScript definition tests verify the type definitions are correct. | `npm run check:tsd` | | 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. | | 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. | -| 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` | +| Explicit Resource Management | `/test/integration/explicit-resource-management` | Tests that use explicit resource management with the driver's disposable resources. | `bash .evergreen/run-resource-management-feature-integration.sh` | ### Spec Tests