[DRIVERS-1593] Test operations may be an empty array Created: 05/Mar/21  Updated: 31/Mar/22

Status: Backlog
Project: Drivers
Component/s: Unified Test Runner
Fix Version/s: None

Type: Spec Change Priority: Major - P3
Reporter: Jeremy Mikola Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Driver Changes: Needed

 Description   

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.



 Comments   
Comment by Alexander Golin (Inactive) [ 15/Mar/21 ]

Triage: placing in the backlog for future prioritization.

Generated at Thu Feb 08 08:23:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.