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
NODE-1854: client side encryption test runner #2033
NODE-1854: client side encryption test runner #2033
Conversation
closed and re-opened to kick off a travis build |
ae79bc2
to
985ac1d
Compare
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.
👍 a few bits that can be dealt with later.
branches: | ||
only: | ||
- master | ||
- next | ||
|
||
before_install: | ||
- wget -O mongocryptd.tgz https://s3.amazonaws.com/mciuploads/mongodb-mongo-v4.2/enterprise-ubuntu1604-64/f92115cad9d2a4c2ddcf3c2c65092dda2fd7147a/binaries/mongo-cryptd-mongodb_mongo_v4.2_enterprise_ubuntu1604_64_f92115cad9d2a4c2ddcf3c2c65092dda2fd7147a_19_06_13_17_31_40.tgz |
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.
nit: in the future, it might be nice to make this an npm script that we can run locally as well.
describe('Client Side Encryption', function() { | ||
const testContext = new TestRunnerContext(); | ||
const testSuites = gatherTestSuites(path.join(__dirname, 'spec', 'client-side-encryption')); | ||
after(() => testContext.teardown()); |
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.
q: can't recall, will the before
and after
scripts run if there are no tests?
@@ -0,0 +1,25 @@ | |||
'use strict'; |
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 shortness of this file makes me so happy
test/functional/runner/index.js
Outdated
'count', | ||
|
||
// we do update validation before the expectation in this test | ||
'an invalid update \(no \$ operators\) is validated and errors', // eslint-disable-line |
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.
Nit: for the future, we should make a skipList
that we pass in to individual calls to generateTopologyTests
instead of having a master list here.
@@ -34,6 +42,37 @@ function generateMatchAndDiffSpecialCase(key, expectedObj, actualObj, metadata) | |||
}; | |||
} | |||
|
|||
if (typeof expected === 'object' && Object.keys(expected)[0] === '$$type') { |
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.
nit: break this part out into a sub-function with a cool name so it is clear what this special case is.
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.
looks good!
213d052
to
0066874
Compare
2865ce5
to
25d5c38
Compare
Description
This completes the POC of Client Side Encryption by enabling the test runner and proving that auto encryption succeeds.
What changed?
The test suite was added, and a few small details of the driver were changed to enable the feature (adding
autoEncryption
to the list of valid option names, etc). There is an incomplete addition to the matcher included here as well for a new$$type
operator. We should flesh this out, but for expediency only the required types have been implemented. The tests will be skipped on local systems that do not have the correct AWS credentials in their environment, but both Travis and Evergreen have been updated to provide these values.Are there any files to ignore?
No