-
Notifications
You must be signed in to change notification settings - Fork 266
PHPLIB-820: Key Management API spec tests #957
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
Conversation
if (FunctionalTestCase::getModuleInfo('libmongocrypt') === 'disabled') { | ||
return false; | ||
} |
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: this could also be extracted to a isDriverWithMongocrypt
or something similar.
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.
Noted. I opted not to do so since it's a one-liner and only called from this context.
I had FunctionalTestCase::skipIfClientSideEncryptionIsNotSupported()
in mind when writing this.
$clientEncryptionOpts['keyVaultClient'] = $this->entityMap->getClient($clientId)->getManager(); | ||
} | ||
|
||
if (isset($clientEncryptionOpts['kmsProviders'])) { |
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.
Noting for the benefit of @levon80999 and others that may want to run these tests: I suggest defining these secrets in a phpunit.xml
file based on phpunit.xml.dist
. This file takes precedence over the dist file and is in gitignore, allowing your own configuration to be added.
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.
This was actually helpful for me as well. I was previously using a shell script to export the environment variables before calling vendor/bin/simple-phpunit
, but phpunit.xml
is much nicer.
This is particularly relevant for kmsProviders tests, which may need to be skipped according to runOnRequirements.csfle
This was causing a test failure for PHP versions before 8.0
@alcaeus: Looking at the CI failures, most pertain to the change stream spec tests and a yet-to-be-synced CSFLE spec test (PHPLIB-930). The actual spec and prose tests from this PR are passing after my most recent fixed for the "valid-fail" tests (72af6d9), and removal of a trailing comma (e8e2405). I'll wait for one last thumbs up from you before merging down. |
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.
LGTM!
* Unified spec and prose tests for CSFLE key management API Support runOnRequirement.csfle, clientEncryption entity/operations, and $$placeholder syntax Synced with mongodb/specifications@10b4a41 * Note ClientEncryption's parent client to ensure events are observed * Set ClientEncryption tlsOptions when KMIP endpoint is used * PHPLIB-929: Prose test for rewrapManyDataKey * Do not consider SkippedTest exceptions as errors for valid-fail tests This is particularly relevant for kmsProviders tests, which may need to be skipped according to runOnRequirements.csfle
https://jira.mongodb.org/browse/PHPLIB-820
https://jira.mongodb.org/browse/PHPLIB-929
Depends on mongodb/mongo-php-driver#1339, but I'd rather not update the CI configs to temporarily test against my fork. Feel free to review the code for now and hold off on examining CI results.