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-2489 Properly skip createChangeStream tests on serverless #1346

Merged
merged 6 commits into from Nov 16, 2022

Conversation

ShaneHarvey
Copy link
Member

@ShaneHarvey ShaneHarvey commented Nov 14, 2022

This PR fixes an issue with the tests added in #1336

Change streams don't yet work on serverless so we have to skip createChangeStream tests there.

Please complete the following before merging:

  • 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).

@ShaneHarvey ShaneHarvey marked this pull request as ready for review November 14, 2022 23:50
@ShaneHarvey ShaneHarvey requested a review from a team as a code owner November 14, 2022 23:50
@ShaneHarvey ShaneHarvey requested review from jmikola and eramongodb and removed request for a team November 14, 2022 23:50
@ShaneHarvey
Copy link
Member Author

Tests are passing in Python here: mongodb/mongo-python-driver#1116

Copy link
Member

@jmikola jmikola left a comment

Choose a reason for hiding this comment

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

The retryable write template changes may be unnecessary but I defer to you.

{%- if operation.operation_name == 'createChangeStream' %}
runOnRequirements:
- serverless: forbid
{%- endif %}
Copy link
Member

Choose a reason for hiding this comment

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

Was this just done for consistency? It seems unlikely that createChangeStream would ever be tested for retryable writes.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems unlikely

Note, this was also why the retryable writes template file does not contain other change stream specific behavior such as saveResultAsEntity.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh I did this without thinking. Removed.

@@ -209,6 +210,8 @@ tests:
commandName: listDatabases

- description: "createChangeStream succeeds after retryable handshake network error"
Copy link
Member Author

Choose a reason for hiding this comment

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

I just found another problem with these tests. The createChangeStream test names are duplicated, "createChangeStream succeeds after retryable handshake network error" appears 3 times. This is a problem since test descriptions are expected to be unique within a file.

@ShaneHarvey
Copy link
Member Author

ShaneHarvey commented Nov 15, 2022

Okay I removed the unneeded retryable-writes template changes and fixed the duplicate descriptions problem (by adding operation.object).

Copy link
Contributor

@eramongodb eramongodb left a comment

Choose a reason for hiding this comment

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

Confirmed the changes pass on the C Driver after updating test descriptions for skipped (unsupported) operations.

@ShaneHarvey ShaneHarvey merged commit 35b17b7 into mongodb:master Nov 16, 2022
@ShaneHarvey ShaneHarvey deleted the DRIVERS-2489 branch November 17, 2022 21:57
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.

None yet

3 participants