Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-2619

fle2v2-CreateCollection tests expect embedded nulls to be treated specially

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Component/s: Client Side Encryption
    • None
    • Needed
    • Hide

      This includes a fix to the fle2v2-CreateCollection test assertions. Update the fle2v2-CreateCollection test to this commit: mongodb/specifications@e59a0ac.

      If the test previously passed, this may suggest a bug in the test runner of the Client Side Encryption legacy format. The matching behavior of `command_started_event` is expected to reject extra captured fields in the subdocuments of `command`.

      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.

      Show
      This includes a fix to the fle2v2-CreateCollection test assertions. Update the fle2v2-CreateCollection test to this commit: mongodb/specifications@e59a0ac . If the test previously passed, this may suggest a bug in the test runner of the Client Side Encryption legacy format. The matching behavior of `command_started_event` is expected to reject extra captured fields in the subdocuments of `command`. 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.
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-4657 Fixed 1.24.0
      CXX-2698 Backlog
      CSHARP-4664 Done 2.20.0
      GODRIVER-2864 Backlog
      JAVA-5016 Done
      NODE-5327 Done 5.7.0
      MOTOR-1138 Duplicate
      PYTHON-3724 Fixed 4.4
      PHPLIB-1157 Fixed 1.16.0
      RUBY-3270 Fixed 2.19.0
      RUST-1671 Backlog
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion CDRIVER-4657 Fixed 1.24.0 CXX-2698 Backlog CSHARP-4664 Done 2.20.0 GODRIVER-2864 Backlog JAVA-5016 Done NODE-5327 Done 5.7.0 MOTOR-1138 Duplicate PYTHON-3724 Fixed 4.4 PHPLIB-1157 Fixed 1.16.0 RUBY-3270 Fixed 2.19.0 RUST-1671 Backlog

      DRIVERS-2524 added a legacy format QE test with embedded null fields in a command_started_event:

              - 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,
      

      https://github.com/mongodb/specifications/blob/aa28f78/source/client-side-encryption/tests/legacy/fle2v2-CreateCollection.yml#L99-L107

      AFAIK only top-level nulls are intended to be treated specially and embedded documents are supposed to be compared with exact match semantics. When implementing this test in PYTHON-3614 I had to add a workaround in pymongo's legacy test runner like this:

                                  # Workaround an incorrect command started event in fle2v2-CreateCollection.yml
                                  # added in DRIVERS-2524.
                                  if key == "encryptedFields":
                                      for n in ("eccCollection", "ecocCollection", "escCollection"):
                                          if val.get(n) is None:
                                              val.pop(n, None)
      

      Is this workaround is required or can we simply remove the escCollection/etc.. fields from the test?

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Kevin Albertson Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: