PYTHON-5947 Vendor the OpenTelemetry unified spec tests - #2993
Draft
blink1073 wants to merge 1 commit into
Draft
Conversation
blink1073
force-pushed
the
PYTHON-5947-otel-3-unified
branch
from
August 17, 2026 22:39
1716de6 to
8e7dd06
Compare
Wire observeTracingMessages and expectTracingMessages into the unified test format runner and vendor the spec's tracing fixtures, plus a resync-specs.sh entry to refresh them. Span attributes are plain Python primitives rather than the BSON-decoded documents the generic match evaluator compares against, so MatchEvaluatorUtil.match_span_attributes adapts them: ints widen to Int64 so the $$type "long" alias matches, and db.mongodb.lsid is rebuilt from its UUID string into the document shape the sessionLsid operator expects. The getMore fixture is held back for the change that adds getMore spans; the other 22 do not exercise getMore.
blink1073
force-pushed
the
PYTHON-5947-otel-3-unified
branch
from
August 17, 2026 22:50
8e7dd06 to
7592441
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PYTHON-5947
Third of four PRs splitting #2964. Base is
PYTHON-5947-otel-2-transactions.PYTHON-5947-otel-1-operationsPYTHON-5947-otel-2-transactionsPYTHON-5947-otel-3-unifiedPYTHON-5947-otel-4-getmoreChanges in this PR
Replaces hand-written assertions with the cross-driver spec suite, so the spans from PRs 1 and 2 are checked against the same fixtures every other driver runs.
observeTracingMessagesandexpectTracingMessagessupport to the unified test format runner.resync-specs.shentry to refresh them.ignoreExtraSpansis enforced at every level of the span tree, not just the top-level array, so a test can assert a span is not nested under a given parent by omitting it.The
getMorefixture is held back for PR 4, which adds the support it needs. The other 22 do not exercisegetMore.Around 4,200 of the 4,600 added lines are
resync-specs.shoutput and another ~150 are generated mirrors, leaving roughly 190 lines to review.The 22 vendored fixtures match
mongodb/specificationsmaster. Two needed fixing upstream first; both are merged in DRIVERS-3597.The tree-wide
ignoreExtraSpansrule is the one piece here not yet on master: it is specified in DRIVERS-3598 (specifications#1973), still open. PR 4's fixture depends on it, since without it that fixture's negative assertions are unenforceable.Test Plan
mapReduce, whoseCollectionmethods PyMongo removed.just lintclean.Checklist
Checklist for Author
Checklist for Reviewer