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

Test operations may be an empty array

    • Needed
    • Hide

      Summary of necessary driver changes

      •  Adds a "valid-pass" test for executing a test with an empty operations array.

      Commits for syncing spec/prose tests

      Show
      Summary of necessary driver changes  Adds a "valid-pass" test for executing a test with an empty operations array. Commits for syncing spec/prose tests  Sync unified test format "valid-pass" tests with mongodb/specifications@c6f23a0
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-5786 Backlog
      CXX-3156 Backlog
      CSHARP-5390 Backlog
      GODRIVER-3408 Backlog
      JAVA-5681 Backlog
      NODE-6489 Needs Triage
      MOTOR-1400 Duplicate
      PYTHON-4936 Needs Triage
      PHPLIB-1578 In Code Review
      RUBY-3580 Backlog
      RUST-2083 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-5786 Backlog CXX-3156 Backlog CSHARP-5390 Backlog GODRIVER-3408 Backlog JAVA-5681 Backlog NODE-6489 Needs Triage MOTOR-1400 Duplicate PYTHON-4936 Needs Triage PHPLIB-1578 In Code Review RUBY-3580 Backlog RUST-2083 Backlog

      While working on mongodb/specifications#925 I realized a discrepancy between the spec and JSON schema.

      In the spec, tests[].operations is documented as a "required array of one or more operation objects"; however, the schema does not specify minItems: 1 for that field.

      Other documentation for withTransaction and loop operations (both of which solicit operations arrays) does not prohibit empty arrays. I'll note that operations are not covered by the JSON schema, so there was no change for discrepancy either way.

      I often use empty tests[].operations arrays when writing "valid-fail" tests, particularly when focused on another aspect of the test format (e.g. entity definitions). I propose that we stick with the JSON schema and simply remove "one or more" from the spec text. Additionally, I would add a "valid-pass" test to assert that a test case with an empty operations array passes. That should catch any drivers that may have been requiring a non-empty array based on the original spec language.

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Andreas Braun Andreas Braun
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: