[SERVER-54152] Clarify usage guidance for arrayEq, orderedArrayEq, documentEq jstest helpers Created: 29/Jan/21  Updated: 29/Oct/23  Resolved: 11/Mar/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Task Priority: Major - P3
Reporter: David Percy Assignee: Milena Ivanova
Resolution: Fixed Votes: 1
Labels: quick-tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 Description   

It looks like we don't need arrayEq and orderedArrayEq, because all the calls happen directly in an assert():

assert(arrayEq(a, b));
assert(orderedArrayEq(x, y));

When should we use these assertion methods instead:

assert.sameMembers(a, b);
assert.eq(x, y);

The assertion methods have better error messages by default: it can print the two values.

We should consider what else in jstests/aggregation/extras/utils.js can be removed, or moved to src/mongo/shell/assert.js.



 Comments   
Comment by Githook User [ 09/Mar/21 ]

Author:

{'name': 'Milena Ivanova', 'email': 'milena.ivanova@mongodb.com', 'username': 'mivanova3'}

Message: SERVER-54152 Clarify usage guidance for arrayEq, orderedArrayEq, documentEq jstest helpers
Branch: master
https://github.com/mongodb/mongo/commit/d20acda5df63b4f8a9b7f04e673a8adea21c8c7f

Generated at Thu Feb 08 05:32:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.