-
Notifications
You must be signed in to change notification settings - Fork 1.8k
test(NODE-5898): small fixes and unskips of test TODOs #4055
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
Changes from all commits
6ed0cc1
1534985
0e99ebd
f346697
a514063
da3fe14
ae7641e
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 |
|---|---|---|
|
|
@@ -3,22 +3,23 @@ import * as path from 'path'; | |
| import { loadSpecTests } from '../../spec'; | ||
| import { runUnifiedSuite } from '../../tools/unified-spec-runner/runner'; | ||
|
|
||
| // This is skipped because our command monitoring happens at the connection | ||
| // level and is using the server reply for the single insert that the bulk | ||
| // performed since it was only one document in the test. The test expectation | ||
| // is that we are using the bulk write result which was returned to the user | ||
| // as the reply in the command succeeded event instead of our raw reply from | ||
| // the server. There's nothing we can change here. | ||
| const SKIP = ['A successful unordered bulk write with an unacknowledged write concern']; | ||
|
|
||
| describe('Command Logging and Monitoring Spec', function () { | ||
| describe('Command Monitoring Spec (unified)', () => { | ||
| runUnifiedSuite( | ||
| loadSpecTests(path.join('command-logging-and-monitoring', 'monitoring')), | ||
| ({ description }) => | ||
| SKIP.includes(description) | ||
| ? `TODO(NODE-4261): support skip reasons in unified tests` | ||
| : false | ||
| ({ description }) => { | ||
| // This is skipped because our command monitoring happens at the connection | ||
| // level and is using the server reply for the single insert that the bulk | ||
| // performed since it was only one document in the test. The test expectation | ||
| // is that we are using the bulk write result which was returned to the user | ||
| // as the reply in the command succeeded event instead of our raw reply from | ||
| // the server. There's nothing we can change here. | ||
| return description.includes( | ||
| 'A successful unordered bulk write with an unacknowledged write concern' | ||
| ) | ||
| ? `Test not applicable to Node.` | ||
| : false; | ||
| } | ||
|
Comment on lines
+10
to
+22
Contributor
Author
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. just added a more applicable skip reason.
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. I do not fully understand why this doesn't apply to us. In a world where we were writing the driver from scratch could it obey this test? if so, could this one day, allegedly, be addressed? |
||
| ); | ||
| }); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,65 +1,85 @@ | ||
| // TODO(NODE-5422): add TS support for FLE in the driver and unskip type tests | ||
| import { expectAssignable, expectError, expectType } from 'tsd'; | ||
|
|
||
| // import { expectAssignable, expectError, expectType, expectNotType, expectNotAssignable } from 'tsd'; | ||
| // import { RangeOptions, AWSEncryptionKeyOptions, AzureEncryptionKeyOptions, ClientEncryption, GCPEncryptionKeyOptions, ClientEncryptionEncryptOptions, KMSProviders } from '../..'; | ||
| import type { | ||
| AWSEncryptionKeyOptions, | ||
| AzureEncryptionKeyOptions, | ||
| ClientEncryption, | ||
| ClientEncryptionEncryptOptions, | ||
| GCPEncryptionKeyOptions, | ||
| KMSProviders, | ||
| RangeOptions | ||
| } from '../..'; | ||
|
|
||
| // type RequiredCreateEncryptedCollectionSettings = Parameters< | ||
| // ClientEncryption['createEncryptedCollection'] | ||
| // >[2]; | ||
| type RequiredCreateEncryptedCollectionSettings = Parameters< | ||
| ClientEncryption['createEncryptedCollection'] | ||
| >[2]; | ||
|
|
||
| // expectError<RequiredCreateEncryptedCollectionSettings>({}); | ||
| // expectError<RequiredCreateEncryptedCollectionSettings>({ | ||
| // provider: 'blah!', | ||
| // createCollectionOptions: { encryptedFields: {} } | ||
| // }); | ||
| // expectError<RequiredCreateEncryptedCollectionSettings>({ | ||
| // provider: 'aws', | ||
| // createCollectionOptions: {} | ||
| // }); | ||
| // expectError<RequiredCreateEncryptedCollectionSettings>({ | ||
| // provider: 'aws', | ||
| // createCollectionOptions: { encryptedFields: null } | ||
| // }); | ||
| expectError<RequiredCreateEncryptedCollectionSettings>({}); | ||
| expectError<RequiredCreateEncryptedCollectionSettings>({ | ||
| provider: 'blah!', | ||
| createCollectionOptions: { encryptedFields: {} } | ||
| }); | ||
| expectError<RequiredCreateEncryptedCollectionSettings>({ | ||
| provider: 'aws', | ||
| createCollectionOptions: {} | ||
| }); | ||
| expectError<RequiredCreateEncryptedCollectionSettings>({ | ||
| provider: 'aws', | ||
| createCollectionOptions: { encryptedFields: null } | ||
| }); | ||
|
|
||
| // expectAssignable<RequiredCreateEncryptedCollectionSettings>({ | ||
| // provider: 'aws', | ||
| // createCollectionOptions: { encryptedFields: {} } | ||
| // }); | ||
| // expectAssignable<RequiredCreateEncryptedCollectionSettings>({ | ||
| // provider: 'aws', | ||
| // createCollectionOptions: { encryptedFields: {} }, | ||
| // masterKey: { } as AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions | ||
| // }); | ||
| expectAssignable<RequiredCreateEncryptedCollectionSettings>({ | ||
| provider: 'aws', | ||
| createCollectionOptions: { encryptedFields: {} } | ||
| }); | ||
| expectAssignable<RequiredCreateEncryptedCollectionSettings>({ | ||
| provider: 'aws', | ||
| createCollectionOptions: { encryptedFields: {} }, | ||
| masterKey: {} as AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions | ||
| }); | ||
|
|
||
| // { | ||
| // // NODE-5041 - incorrect spelling of rangeOpts in typescript definitions | ||
| // const options = {} as ClientEncryptionEncryptOptions; | ||
| // expectType<RangeOptions | undefined>(options.rangeOptions) | ||
| // } | ||
| { | ||
| // NODE-5041 - incorrect spelling of rangeOpts in typescript definitions | ||
| const options = {} as ClientEncryptionEncryptOptions; | ||
| expectType<RangeOptions | undefined>(options.rangeOptions); | ||
| } | ||
|
|
||
| // { | ||
| // // KMSProviders | ||
| // // aws | ||
| // expectAssignable<KMSProviders['aws']>({ accessKeyId: '', secretAccessKey: '' }); | ||
| // expectAssignable<KMSProviders['aws']>({ accessKeyId: '', secretAccessKey: '', sessionToken: undefined }); | ||
| // expectAssignable<KMSProviders['aws']>({ accessKeyId: '', secretAccessKey: '', sessionToken: '' }); | ||
| // // automatic | ||
| // expectAssignable<KMSProviders['aws']>({}); | ||
| { | ||
| // KMSProviders | ||
| // aws | ||
| expectAssignable<KMSProviders['aws']>({ accessKeyId: '', secretAccessKey: '' }); | ||
| expectAssignable<KMSProviders['aws']>({ | ||
| accessKeyId: '', | ||
| secretAccessKey: '', | ||
| sessionToken: undefined | ||
| }); | ||
| expectAssignable<KMSProviders['aws']>({ accessKeyId: '', secretAccessKey: '', sessionToken: '' }); | ||
| // automatic | ||
| expectAssignable<KMSProviders['aws']>({}); | ||
|
|
||
| // // azure | ||
| // expectAssignable<KMSProviders['azure']>({ tenantId: 'a', clientId: 'a', clientSecret: 'a' }); | ||
| // expectAssignable<KMSProviders['azure']>({ tenantId: 'a', clientId: 'a', clientSecret: 'a' }); | ||
| // expectAssignable<KMSProviders['azure']>({ tenantId: 'a', clientId: 'a', clientSecret: 'a', identityPlatformEndpoint: undefined }); | ||
| // expectAssignable<KMSProviders['azure']>({ tenantId: 'a', clientId: 'a', clientSecret: 'a', identityPlatformEndpoint: '' }); | ||
| // expectAssignable<KMSProviders['azure']>({ accessToken: 'a' }); | ||
| // expectAssignable<KMSProviders['azure']>({}); | ||
| // azure | ||
| expectAssignable<KMSProviders['azure']>({ tenantId: 'a', clientId: 'a', clientSecret: 'a' }); | ||
| expectAssignable<KMSProviders['azure']>({ tenantId: 'a', clientId: 'a', clientSecret: 'a' }); | ||
| expectAssignable<KMSProviders['azure']>({ | ||
| tenantId: 'a', | ||
| clientId: 'a', | ||
| clientSecret: 'a', | ||
| identityPlatformEndpoint: undefined | ||
| }); | ||
| expectAssignable<KMSProviders['azure']>({ | ||
| tenantId: 'a', | ||
| clientId: 'a', | ||
| clientSecret: 'a', | ||
| identityPlatformEndpoint: '' | ||
| }); | ||
| expectAssignable<KMSProviders['azure']>({ accessToken: 'a' }); | ||
| expectAssignable<KMSProviders['azure']>({}); | ||
|
|
||
| // // gcp | ||
| // expectAssignable<KMSProviders['gcp']>({ email: 'a', privateKey: 'a' }); | ||
| // expectAssignable<KMSProviders['gcp']>({ email: 'a', privateKey: 'a', endpoint: undefined }); | ||
| // expectAssignable<KMSProviders['gcp']>({ email: 'a', privateKey: 'a', endpoint: 'a' }); | ||
| // expectAssignable<KMSProviders['gcp']>({ accessToken: 'a' }); | ||
| // // automatic | ||
| // expectAssignable<KMSProviders['gcp']>({}); | ||
|
|
||
| // } | ||
| // gcp | ||
| expectAssignable<KMSProviders['gcp']>({ email: 'a', privateKey: 'a' }); | ||
| expectAssignable<KMSProviders['gcp']>({ email: 'a', privateKey: 'a', endpoint: undefined }); | ||
| expectAssignable<KMSProviders['gcp']>({ email: 'a', privateKey: 'a', endpoint: 'a' }); | ||
| expectAssignable<KMSProviders['gcp']>({ accessToken: 'a' }); | ||
| // automatic | ||
| expectAssignable<KMSProviders['gcp']>({}); | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.