[CDRIVER-3960] Convert CRUD v2 spec tests to unified test format Created: 20/Apr/21  Updated: 28/Oct/23  Resolved: 16/Jun/21

Status: Closed
Project: C Driver
Component/s: tests
Affects Version/s: None
Fix Version/s: 1.18.0

Type: Improvement Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Jeremy Mikola
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
Related
Epic Link: Migrate all Spec Tests to The Unified Test Runner

 Description   

DRIVERS Ticket Description
Script Target - If you can read this text, the script has failed


 Comments   
Comment by Githook User [ 21/Jun/21 ]

Author:

{'name': 'Jeremy Mikola', 'email': 'jmikola@gmail.com', 'username': 'jmikola'}

Message: CDRIVER-3895: Remove dots/dollars validation for insert/replace docs (#801)

  • CDRIVER-3895: Update CRUD, transactions, and unified spec tests

Also replaces CRUD legacy/v2 tests with unified equivalents for CDRIVER-3960.

Synced with mongodb/specifications@a124e21be89cbfc78606725c6ed1fa00dc992777

  • Ensure upsertedIds is always present in BulkWriteResult
  • Allow array or document for updateOne/Many update arg
  • Remove dot/dollar restrictions for insert/replace validation

This adds top-level key validation to _mongoc_validate_replace, similar to what existed in _mongoc_validate_update.

  • Remove redundant replace doc validation for legacy updates

Replacement docs will already be validated by _mongoc_validate_replace before this function is reached.

This adds logic to ensure "q" and "u" documents are present, similar to what existed in _mongoc_write_command_delete_legacy.

  • Test success and failure for legacy update code path

The failure code path is testing that arguments are still validated by mongoc-util.c, despite replacement validation being removed in a previous commit.

  • Revert "Skip tests with dots and dollars in field names on 5.0+ (#795)"

This reverts commit bd014ee7995420d5d1d2db8a10348f0b24d09090.

  • Revise bulk and collection tests for allowing dots/dollars

Empty keys can be used as a reliable BSON validation error, since insert, replace, and update all specify BSON_VALIDATE_EMPTY_KEYS in their vflags. Error message expectations are adjusted accordingly.

An _id document with a dollar-prefixed key is also used as a reliable server-side validation error.

  • Allow methods in bulk_op_append to fail so expectError can be evaluated
  • Skip unified tests due to schema version and outstanding issues

Allow entire files to be skipped to preempt schema version errors.

  • Ensure WC is set on database and collection entities

Co-authored-by: Kevin Albertson <kevin.albertson@10gen.com>
Branch: r1.18
https://github.com/mongodb/mongo-c-driver/commit/4069b7984d3b089195d4c7ff1fd58c3d6bc2aedc

Comment by Githook User [ 16/Jun/21 ]

Author:

{'name': 'Jeremy Mikola', 'email': 'jmikola@gmail.com', 'username': 'jmikola'}

Message: CDRIVER-3895: Remove dots/dollars validation for insert/replace docs (#801)

  • CDRIVER-3895: Update CRUD, transactions, and unified spec tests

Also replaces CRUD legacy/v2 tests with unified equivalents for CDRIVER-3960.

Synced with mongodb/specifications@a124e21be89cbfc78606725c6ed1fa00dc992777

  • Ensure upsertedIds is always present in BulkWriteResult
  • Allow array or document for updateOne/Many update arg
  • Remove dot/dollar restrictions for insert/replace validation

This adds top-level key validation to _mongoc_validate_replace, similar to what existed in _mongoc_validate_update.

  • Remove redundant replace doc validation for legacy updates

Replacement docs will already be validated by _mongoc_validate_replace before this function is reached.

This adds logic to ensure "q" and "u" documents are present, similar to what existed in _mongoc_write_command_delete_legacy.

  • Test success and failure for legacy update code path

The failure code path is testing that arguments are still validated by mongoc-util.c, despite replacement validation being removed in a previous commit.

  • Revert "Skip tests with dots and dollars in field names on 5.0+ (#795)"

This reverts commit bd014ee7995420d5d1d2db8a10348f0b24d09090.

  • Revise bulk and collection tests for allowing dots/dollars

Empty keys can be used as a reliable BSON validation error, since insert, replace, and update all specify BSON_VALIDATE_EMPTY_KEYS in their vflags. Error message expectations are adjusted accordingly.

An _id document with a dollar-prefixed key is also used as a reliable server-side validation error.

  • Allow methods in bulk_op_append to fail so expectError can be evaluated
  • Skip unified tests due to schema version and outstanding issues

Allow entire files to be skipped to preempt schema version errors.

  • Ensure WC is set on database and collection entities

Co-authored-by: Kevin Albertson <kevin.albertson@10gen.com>
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/2597f6d4d229f437b3b2cdce0e941a925f24491d

Comment by Jeremy Mikola [ 07/Jun/21 ]

New tests will be pulled in with CDRIVER-3895.

Generated at Wed Feb 07 21:19:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.