Skip to content
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

Merged
merged 13 commits into from Jul 25, 2019

Conversation

mbroadst
Copy link
Member

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

@mbroadst mbroadst changed the base branch from master to next June 15, 2019 13:28
@mbroadst mbroadst closed this Jun 15, 2019
@mbroadst mbroadst reopened this Jun 15, 2019
@mbroadst
Copy link
Member Author

closed and re-opened to kick off a travis build

@mbroadst mbroadst force-pushed the NODE-1854/client-side-encryption-test-runner branch from ae79bc2 to 985ac1d Compare June 16, 2019 12:49
Copy link
Contributor

@daprahamian daprahamian left a 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
Copy link
Contributor

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());
Copy link
Contributor

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';
Copy link
Contributor

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

'count',

// we do update validation before the expectation in this test
'an invalid update \(no \$ operators\) is validated and errors', // eslint-disable-line
Copy link
Contributor

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') {
Copy link
Contributor

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.

Copy link
Contributor

@kvwalker kvwalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@mbroadst mbroadst force-pushed the NODE-1854/client-side-encryption-test-runner branch from 213d052 to 0066874 Compare July 23, 2019 15:23
@daprahamian daprahamian force-pushed the NODE-1854/client-side-encryption-test-runner branch from 2865ce5 to 25d5c38 Compare July 24, 2019 20:04
@daprahamian daprahamian merged commit 467ec15 into next Jul 25, 2019
@daprahamian daprahamian deleted the NODE-1854/client-side-encryption-test-runner branch July 25, 2019 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants