[DRIVERS-2109] Add tests to Index Management spec Created: 23/Apr/19  Updated: 28/Jul/22

Status: Backlog
Project: Drivers
Component/s: Index Management
Fix Version/s: None

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

Issue Links:
Duplicate
Related
related to SERVER-769 Validate top-level & index spec field... Closed
Driver Changes: Needed

 Description   

The Index management specification does not include any prose or YAML/JSON tests. We should consider adding some.

An important part of these tests would be to check that all the options for createIndexes are accepted by the server. As of MongoDB 3.4, the server validates those options (see SERVER-769). This was not the case when the spec was written.

Testing the options behavior is particularly important because the server's createIndexes command does not align with many of the option names in the spec. For example:

  • version in driver = v on server
  • defaultLanguage in driver = default_language on server
  • languageOverride in driver = language_override on server
  • until SPEC-1111, the spec contained an expireAfter option corresponding to expireAfterSeconds on the server (now renamed to match.)

This is an easy place for errors to be introduced in drivers like Swift that use a BSONEncoder to convert options types to documents, where keys are automatically named by the property names (see SWIFT-404.)

SPEC-1111 pointed out (and fixed) that storageEngine is supposed to be a document, not a string. A spec test case including the storageEngine option would easily catch this.



 Comments   
Comment by Kaitlin Mahar [ 23/Apr/19 ]

jmikola suggested on SPEC-1111 that some of the naming discrepancies are intentionally there so users don't have to deal with the weird mix of camel case and snake case naming on the server command options (outside the ones I listed above, they are all camel case). I think that is sensible, but the spec should at least note the intentional deviation. 

Comment by Bernie Hackett [ 23/Apr/19 ]

Seems like we need more than just tests. The spec needs to be updated with the proper option names as well.

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