Propagate simulator device/OS tags from inner test spans to runner spans#283
Merged
ypopovych merged 3 commits intoJun 16, 2026
Merged
Conversation
The integration test runner always executes on macOS, so its DDTest spans were tagged with macOS device info even when the inner tests ran on a simulator (iOS, tvOS, watchOS, visionOS). After xcodebuild finishes, copy os.platform, os.architecture, os.version, device.name, and device.model from the first received span onto DDTest.current — but only when the inner platform is not macOS, where the runner tags are already correct. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ectly
Device/OS tags are written into the envelope-level metadata under the
"test_levels" key by the SDK. SpanEvent.extend only merges metadata keyed
by span.type ("test", "span", etc.) and "*", so span.meta never contains
os.platform — making the previous guard always fail and the whole block
get skipped.
Fix: read from envelope.metadata["test_levels"] directly. For each device
tag key, prefer a value found in individual span meta (spans can override
via set(tag:)), falling back to the envelope metadata value.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ns only Merge priority (highest to lowest): span.meta > metadata[span.type] > metadata["test_levels"] > metadata["*"] metadata["test_levels"] carries device/OS tags shared across all test-level events. It is applied only to test* spans (.test, suiteEnd, moduleEnd, sessionEnd) — not to generic "span" events where it does not belong. With test_levels now correctly merged into extended spans, the runner's device tag propagation can read from allSpans.meta directly (reverted from the previous direct envelope.metadata["test_levels"] workaround). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
gnufede
approved these changes
Jun 16, 2026
ypopovych
deleted the
fix/propagate-simulator-device-tags-to-runner-spans
branch
June 16, 2026 16:54
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.
Summary
MockBackend, copyos.platform,os.architecture,os.version,device.name, anddevice.modelfrom the first received span ontoDDTest.current."macOS"— in that case the runner's own tags are already correct.Test plan
iOS simulator,iPhone 16) instead of macOS host info.🤖 Generated with Claude Code