Skip to content

DRIVERS-3597 Fix over-strict update assertion and missing initialData in OpenTelemetry spec tests - #1971

Draft
blink1073 wants to merge 1 commit into
mongodb:masterfrom
blink1073:DRIVERS-3597
Draft

DRIVERS-3597 Fix over-strict update assertion and missing initialData in OpenTelemetry spec tests#1971
blink1073 wants to merge 1 commit into
mongodb:masterfrom
blink1073:DRIVERS-3597

Conversation

@blink1073

Copy link
Copy Markdown
Member

DRIVERS-3597

Two problems in the OpenTelemetry operation fixtures forced drivers to carry local patches or skips instead of running the shared tests as written. Both are test-only.

  • The update assertion required the update statement to contain exactly a query and an update document, so drivers that also send multi and upsert at their default values failed it. It now accepts either shape, as the CRUD spec's own tests do.
  • Fixtures that create or modify collections declared no initial data, so the runner never cleaned up beforehand and they were not repeatable within a single process. They now declare it.

list_collections and list_databases are unchanged, since neither creates or modifies a collection.

Python implementation: mongodb/mongo-python-driver#2964

PyMongo currently skips the update test and adds its own cleanup to work around these two problems. PYTHON-5979 removes both workarounds once this merges.

Please complete the following before merging:

  • Is the relevant DRIVERS ticket in the PR title?
  • Update changelog.
  • Test changes in at least one language driver.
  • Test these changes against all server versions and topologies (including standalone, replica set, and sharded
    clusters).

The full Evergreen matrix is still running on the PyMongo PR; I will confirm it before merge.

… in OpenTelemetry spec tests

Allow the update statement assertion to accept multi and upsert at their
default values, matching how the CRUD spec's own tests are written.

Add initialData to the operation fixtures that create or modify
collections so the runner cleans up beforehand and each fixture is
repeatable within a single process.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates OpenTelemetry operation test fixtures to be more portable across drivers by relaxing an over-strict update command assertion and making operation fixtures repeatable via initialData setup.

Changes:

  • Relaxed the update command expectation to allow multi/upsert to be omitted or present with default false.
  • Added initialData to operation fixtures that create/modify collections to ensure clean, repeatable runs.
  • Updated the OpenTelemetry spec changelog to record the test fixture changes.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
source/open-telemetry/tests/operation/update.yml Adds initialData and relaxes the updates assertion to accept optional multi/upsert.
source/open-telemetry/tests/operation/update.json Regenerated JSON reflecting the updated update.yml fixture.
source/open-telemetry/tests/operation/find_and_modify.yml Adds initialData for repeatability.
source/open-telemetry/tests/operation/find_and_modify.json Regenerated JSON reflecting the updated find_and_modify.yml fixture.
source/open-telemetry/tests/operation/drop_indexes.yml Adds initialData for repeatability.
source/open-telemetry/tests/operation/drop_indexes.json Regenerated JSON reflecting the updated drop_indexes.yml fixture.
source/open-telemetry/tests/operation/drop_collection.yml Adds initialData for repeatability.
source/open-telemetry/tests/operation/drop_collection.json Regenerated JSON reflecting the updated drop_collection.yml fixture.
source/open-telemetry/tests/operation/delete.yml Adds initialData for repeatability.
source/open-telemetry/tests/operation/delete.json Regenerated JSON reflecting the updated delete.yml fixture.
source/open-telemetry/tests/operation/create_indexes.yml Adds initialData for repeatability.
source/open-telemetry/tests/operation/create_indexes.json Regenerated JSON reflecting the updated create_indexes.yml fixture.
source/open-telemetry/tests/operation/create_collection.yml Adds initialData and includes an explicit dropCollection operation (with tracing expectations) to ensure repeatability.
source/open-telemetry/tests/operation/create_collection.json Regenerated JSON reflecting the updated create_collection.yml fixture.
source/open-telemetry/tests/operation/atlas_search.yml Adds initialData for repeatability.
source/open-telemetry/tests/operation/atlas_search.json Regenerated JSON reflecting the updated atlas_search.yml fixture.
source/open-telemetry/tests/operation/aggregate.yml Adds initialData for repeatability.
source/open-telemetry/tests/operation/aggregate.json Regenerated JSON reflecting the updated aggregate.yml fixture.
source/open-telemetry/open-telemetry.md Adds a changelog entry describing the fixture updates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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