-
Notifications
You must be signed in to change notification settings - Fork 1.8k
test(NODE-7426): Add appName to OIDC test failpoints #4869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -265,6 +265,17 @@ export class UnifiedMongoClient extends MongoClient { | |
| }; | ||
| } | ||
|
|
||
| // Test descriptions use `appName` and `appname` interchangeably | ||
| if ( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should not need to modify the unified test runner, since there was no change to the unified test runner specification. The appName for unified tests is already passed in directly via the spec files themselves. You may find it helpful to look at the reference implementations linked in the spec PR (mongodb/specifications#1891), for example the python one here. |
||
| 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; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The annotations are helpful, however, the new requirement in the spec is to ensure that we not only remove the failpoint but also always set the appName for any failpoint created. In this file, there are two types of clients - the regular one and the util client (with the util clients being used to set fail points), with some clients instantiated via
new MongoClientand others via thegetClientmethod, so we want to make sure that we always configure the clients being tested and the failpoints set in the test with an appName.