Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRIVERS-1710: Convert retryable reads spec tests to unified test format #1536

Merged
merged 17 commits into from
Mar 11, 2024

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Mar 5, 2024

https://jira.mongodb.org/browse/DRIVERS-1710

Please complete the following before merging:

  • Update changelog.
  • Make sure there are generated JSON files from the YAML test files.
  • Test changes in at least one language driver.
  • Test these changes against all server versions and topologies (including standalone, replica set, sharded
    clusters, and serverless).

POC: mongodb/mongo-php-library#1247

Drivers may differ in how they query the chunks collection. For instance, PHPLIB queries the chunk's n field with $gte in addition to files_id. Rather than use $$matchAsRoot (schema version 1.13+) to emulate the legacy test behavior of ignoring extra fields, the commandStartedEvent assertion was relaxed and expectResult was introduced to assert that the file is read successfully.
This also renumbers the prose tests
find: *chunks_collection_name
# Avoid checking additional fields since the exact query may
# differ among drivers. expectResult is sufficient to assert
# correctness.
Copy link
Member Author

@jmikola jmikola Mar 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quoting the commit:

Drivers may differ in how they query the chunks collection. For instance, PHPLIB queries the chunk's n field with $gte in addition to files_id. Rather than use $$matchAsRoot (schema version 1.13+) to emulate the legacy test behavior of ignoring extra fields, the commandStartedEvent assertion was relaxed and expectResult was introduced to assert that the file is read successfully.

I know various drivers are behind on schema versions, so sticking with an older version seemed preferable. The chunk query also isn't vital to these tests, and expectResult with $$matchesHexBytes is overall an improvement IMO.


PoolClearedError Retryability Test
==================================
1. PoolClearedError Retryability Test
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: prose tests were originally not numbered.

@jmikola jmikola marked this pull request as ready for review March 6, 2024 20:16
@jmikola jmikola requested review from a team as code owners March 6, 2024 20:16
@jmikola jmikola requested review from alcaeus and kkloberdanz and removed request for a team March 6, 2024 20:16
jmikola added a commit to jmikola/mongo-php-library that referenced this pull request Mar 6, 2024
@jyemin jyemin self-requested a review March 6, 2024 20:57
@jyemin jyemin self-requested a review March 7, 2024 22:45
@jmikola
Copy link
Member Author

jmikola commented Mar 8, 2024

@kkloberdanz: Feel free to remove yourself from the list of reviewers since we've already got two drivers passing the converted tests.

@jmikola jmikola merged commit 85fa23f into mongodb:master Mar 11, 2024
4 checks passed
@jmikola jmikola deleted the drivers-1710 branch March 11, 2024 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants