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

Test operations may be an empty array

    • Type: Icon: Spec Change Spec Change
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Component/s: Unified Test Runner
    • Labels:
      None
    • Needed

      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:
            Unassigned Unassigned
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: