Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions test/integration/auth/mongodb_oidc.prose.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ describe('OIDC Auth Spec Tests', function () {
});

afterEach(async function () {
// explicitly remove the fail point to prevent interaction betweet test runs
Comment thread
dariakp marked this conversation as resolved.
Outdated
Comment thread
dariakp marked this conversation as resolved.
Outdated
await utilClient.db().admin().command({
configureFailPoint: 'failCommand',
mode: 'off'
Expand Down Expand Up @@ -402,6 +403,7 @@ describe('OIDC Auth Spec Tests', function () {
});

afterEach(async function () {
// explicitly remove the fail point to prevent interaction betweet test runs
await utilClient.db().admin().command({
configureFailPoint: 'failCommand',
mode: 'off'
Expand Down Expand Up @@ -457,6 +459,7 @@ describe('OIDC Auth Spec Tests', function () {
});

afterEach(async function () {
// explicitly remove the fail point to prevent interaction betweet test runs
await utilClient.db().admin().command({
configureFailPoint: 'failCommand',
mode: 'off'
Expand Down Expand Up @@ -522,6 +525,7 @@ describe('OIDC Auth Spec Tests', function () {
});

afterEach(async function () {
// explicitly remove the fail point to prevent interaction betweet test runs
await utilClient?.db().admin().command({
configureFailPoint: 'failCommand',
mode: 'off'
Expand Down Expand Up @@ -587,6 +591,7 @@ describe('OIDC Auth Spec Tests', function () {
});

afterEach(async function () {
// explicitly remove the fail point to prevent interaction betweet test runs
await utilClient?.db().admin().command({
configureFailPoint: 'failCommand',
mode: 'off'
Expand Down Expand Up @@ -654,6 +659,7 @@ describe('OIDC Auth Spec Tests', function () {
});

afterEach(async function () {
// explicitly remove the fail point to prevent interaction betweet test runs
await utilClient?.db().admin().command({
configureFailPoint: 'failCommand',
mode: 'off'
Expand Down Expand Up @@ -733,6 +739,7 @@ describe('OIDC Auth Spec Tests', function () {
});

afterEach(async function () {
// explicitly remove the fail point to prevent interaction betweet test runs
await utilClient.db().admin().command({
configureFailPoint: 'failCommand',
mode: 'off'
Expand Down Expand Up @@ -1089,6 +1096,7 @@ describe('OIDC Auth Spec Tests', function () {
});

afterEach(async function () {
// explicitly remove the fail point to prevent interaction betweet test runs
await utilClient.db().admin().command({
configureFailPoint: 'failCommand',
mode: 'off'
Expand Down Expand Up @@ -1190,6 +1198,7 @@ describe('OIDC Auth Spec Tests', function () {
});

afterEach(async function () {
// explicitly remove the fail point to prevent interaction betweet test runs
await utilClient.db().admin().command({
configureFailPoint: 'failCommand',
mode: 'off'
Expand Down Expand Up @@ -1252,6 +1261,7 @@ describe('OIDC Auth Spec Tests', function () {
});

afterEach(async function () {
// explicitly remove the fail point to prevent interaction betweet test runs
await utilClient.db().admin().command({
configureFailPoint: 'failCommand',
mode: 'off'
Expand Down Expand Up @@ -1348,6 +1358,7 @@ describe('OIDC Auth Spec Tests', function () {
});

afterEach(async function () {
// explicitly remove the fail point to prevent interaction betweet test runs
await utilClient.db().admin().command({
configureFailPoint: 'failCommand',
mode: 'off'
Expand Down Expand Up @@ -1419,6 +1430,7 @@ describe('OIDC Auth Spec Tests', function () {
});

afterEach(async function () {
// explicitly remove the fail point to prevent interaction betweet test runs
await utilClient.db().admin().command({
configureFailPoint: 'failCommand',
mode: 'off'
Expand Down Expand Up @@ -1496,6 +1508,7 @@ describe('OIDC Auth Spec Tests', function () {
});

afterEach(async function () {
// explicitly remove the fail point to prevent interaction betweet test runs
await utilClient.db().admin().command({
configureFailPoint: 'failCommand',
mode: 'off'
Expand Down Expand Up @@ -1581,6 +1594,7 @@ describe('OIDC Auth Spec Tests', function () {
});

afterEach(async function () {
// explicitly remove the fail point to prevent interaction betweet test runs
await utilClient.db().admin().command({
configureFailPoint: 'failCommand',
mode: 'off'
Expand Down
21 changes: 14 additions & 7 deletions test/spec/auth/unified/mongodb-oidc-no-retry.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
{
"minServerVersion": "7.0",
"auth": true,
"authMechanism": "MONGODB-OIDC"
"authMechanism": "MONGODB-OIDC",
"serverless": "forbid"
}
],
"createEntities": [
Expand All @@ -24,7 +25,8 @@
"$$placeholder": 1
},
"retryReads": false,
"retryWrites": false
"retryWrites": false,
"appName": "mongodb-oidc-no-retry"
},
"observeEvents": [
"commandStartedEvent",
Expand Down Expand Up @@ -146,7 +148,8 @@
"failCommands": [
"find"
],
"errorCode": 391
"errorCode": 391,
"appName": "mongodb-oidc-no-retry"
}
}
}
Expand Down Expand Up @@ -211,7 +214,8 @@
"failCommands": [
"insert"
],
"errorCode": 391
"errorCode": 391,
"appName": "mongodb-oidc-no-retry"
}
}
}
Expand Down Expand Up @@ -288,7 +292,8 @@
"failCommands": [
"insert"
],
"closeConnection": true
"closeConnection": true,
"appName": "mongodb-oidc-no-retry"
}
}
}
Expand Down Expand Up @@ -320,7 +325,8 @@
"failCommands": [
"saslStart"
],
"errorCode": 18
"errorCode": 18,
"appName": "mongodb-oidc-no-retry"
}
}
}
Expand Down Expand Up @@ -397,7 +403,8 @@
"failCommands": [
"saslStart"
],
"errorCode": 18
"errorCode": 18,
"appName": "mongodb-oidc-no-retry"
}
}
}
Expand Down
11 changes: 9 additions & 2 deletions test/spec/auth/unified/mongodb-oidc-no-retry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ runOnRequirements:
- minServerVersion: "7.0"
auth: true
authMechanism: "MONGODB-OIDC"
serverless: forbid
createEntities:
- client:
id: &failPointClient failPointClient
Expand All @@ -20,6 +21,7 @@ createEntities:
authMechanismProperties: { $$placeholder: 1 }
retryReads: false
retryWrites: false
appName: &appName mongodb-oidc-no-retry
observeEvents:
- commandStartedEvent
- commandSucceededEvent
Expand Down Expand Up @@ -86,6 +88,7 @@ tests:
failCommands:
- find
errorCode: 391 # ReauthenticationRequired
appName: *appName
- name: find
object: collection0
arguments:
Expand Down Expand Up @@ -120,6 +123,7 @@ tests:
failCommands:
- insert
errorCode: 391 # ReauthenticationRequired
appName: *appName
- name: insertOne
object: collection0
arguments:
Expand Down Expand Up @@ -159,6 +163,7 @@ tests:
failCommands:
- insert
closeConnection: true
appName: *appName
- name: insertOne
object: collection0
arguments:
Expand All @@ -179,6 +184,7 @@ tests:
failCommands:
- saslStart
errorCode: 18
appName: *appName
- name: insertOne
object: collection0
arguments:
Expand Down Expand Up @@ -212,17 +218,18 @@ tests:
client: failPointClient
failPoint:
configureFailPoint: failCommand
mode:
mode:
times: 1
data:
failCommands:
- saslStart
errorCode: 18
appName: *appName
- name: insertOne
object: collection0
arguments:
document:
_id: 1
x: 1
expectError:
errorCode: 18
errorCode: 18
11 changes: 11 additions & 0 deletions test/tools/unified-spec-runner/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,17 @@ export class UnifiedMongoClient extends MongoClient {
};
}

// Test descriptions use `appName` and `appname` interchangeably
if (
Comment thread
dariakp marked this conversation as resolved.
Outdated
description.uriOptions &&
(description.uriOptions.appName != null || description.uriOptions.appname != null)
) {
options.appName = description.uriOptions.appName ?? description.uriOptions.appname;
} else {
const appNameNonce = new Date().getTime().toString();
options.appName = `unified-spec-runner-${appNameNonce}`;
}

super(uri, options);
this.observedEventEmitter.on('error', () => null);
this.logCollector = logCollector;
Expand Down