Remove null values from command_started_event in fle2v2-CreateCollection.yml.
Link to legacy command monitoring spec tests runner in transactions test README.rst.
Note null is only expected in top level fields of command.
The C driver incorrectly allows extra fields in subdocuments of the command. With this behavior fixed, the updated fle2v2-CreateCollection.yml test was run in this patch
Background & Motivation
DRIVERS-2524 added a legacy Client Side Encryption (CSE) test with embedded null fields in a command_started_event in fle2v2-CreateCollection.yml:
- command_started_event:
command:
create: *encrypted_collection_name
encryptedFields: &encrypted_fields_expectation {
# Expect state collections are not included in the encryptedFields sent to the server.
"escCollection": null,
"ecocCollection": null,
"eccCollection": null,
The null fields are intended to assert that escCollection, ecocCollection and eccCollection are not present in the encryptedFields document.
If the test includes a list of command-started events in expectations,
compare them to the actual command-started events using the
same logic as the Command Monitoring Spec Tests runner, plus the rules in
the Command-Started Events instructions below.
The driver MUST assert the expected data is present and also MUST allow for additional data to be present as well at the top level of the command document or reply document.
However, if there are fields in command subdocuments that are not mentioned in the YAML, then the command does not pass the test
This suggests test runners are expected not to allow extra fields in subdocuments of the command. Test runners are not expected to handle null values specially for subdocuments of the command.
[ ] Update changelog.N/A. Only test README and test files changed
[x] Make sure there are generated JSON files from the YAML test files.
[x] Test changes in at least one language driver. Tested in C
[ ] Test these changes against all server versions and topologies (including standalone, replica set, sharded clusters, and serverless).C does not test legacy CSFLE tests on sharded clusters or serverless.
Summary
command_started_event
in fle2v2-CreateCollection.yml.null
is only expected in top level fields ofcommand
.The C driver incorrectly allows extra fields in subdocuments of the
command
. With this behavior fixed, the updatedfle2v2-CreateCollection.yml
test was run in this patchBackground & Motivation
DRIVERS-2524 added a legacy Client Side Encryption (CSE) test with embedded null fields in a
command_started_event
in fle2v2-CreateCollection.yml:The null fields are intended to assert that
escCollection
,ecocCollection
andeccCollection
are not present in theencryptedFields
document.The legacy CSE format is based on the legacy Transactions test format. The legacy Transaction test README references the Command Monitoring Spec Tests runner:
The legacy Command Monitoring Spec test format README was removed in https://github.com/mongodb/specifications/commit/c51e7373aab211ed673061bd6fdb542f655e413d#diff-5c0a965655147652fef540421431fb48533cd30c9120331276a7776ecc5171e2L62 and included:
This suggests test runners are expected not to allow extra fields in subdocuments of the
command
. Test runners are not expected to handlenull
values specially for subdocuments of thecommand
.This resulted in necessary workarounds in the pymongo test runner.
Please complete the following before merging:
[ ] Update changelog.N/A. Only test README and test files changed[ ] Test these changes against all server versions and topologies (including standalone, replica set, sharded clusters, and serverless).C does not test legacy CSFLE tests on sharded clusters or serverless.