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-2797 Check for substring in Index Management error asserts #1485

Merged
merged 2 commits into from
Dec 20, 2023

Conversation

kevinAlbs
Copy link
Contributor

@kevinAlbs kevinAlbs commented Dec 19, 2023

Summary

Check for substring in Index Management error asserts

Background & Motivation

Atlas Search Index specification tests expect an error returned from a non-Atlas server. Example:

        expectError:
          # This test always errors in a non-Atlas environment.  The test functions as a unit test  by asserting
          # that the driver constructs and sends the correct command.
          isError: true
          errorContains: Search index commands are only supported with Atlas

SERVER-83290 changed the error message from:

Search index commands are only supported with Atlas

to:

Using Atlas Search Database Commands and the $listSearchIndexes aggregation stage requires additional configuration. Please connect to Atlas or an AtlasCLI local deployment to enable. For more information on how to connect, see https://dochub.mongodb.org/core/atlas-cli-deploy-local-reqs

The message change causes this test to fail in driver tests with latest server builds.

This PR proposes using "Atlas" as a common substring in both errors.

Updated tests were verified in C driver:
https://spruce.mongodb.com/version/6581c5d12a60ed6df70bbe25

Rejected alternatives

Checking the server error code was considered as an alternative. The returned errorCode also appears to have changed.


Please complete the following before merging:

  • [ ] Update changelog. N/A.
  • Make sure there are generated JSON files from the YAML test files.
  • Test changes in at least one language driver. Tested in C
  • [] Test these changes against all server versions and topologies (including standalone, replica set, sharded clusters, and serverless). Tested with replica set and sharded cluster. Tests are not run in C driver load balancer tasks

@kevinAlbs kevinAlbs marked this pull request as ready for review December 19, 2023 16:50
@kevinAlbs kevinAlbs requested a review from a team as a code owner December 19, 2023 16:50
@kevinAlbs kevinAlbs requested review from dariakp and removed request for a team and dariakp December 19, 2023 16:50
@kevinAlbs kevinAlbs removed the request for review from nbbeeken December 20, 2023 15:26
@kevinAlbs kevinAlbs merged commit 6943ba1 into mongodb:master Dec 20, 2023
4 checks passed
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.

2 participants