Parse allure.id from Swift Testing comments#93
Open
BorisLys wants to merge 8 commits into
Open
Conversation
Swift Testing serializes trait comments into ActionTestSummary.documentation._values[].content._value, separately from activitySummaries. The existing parser only inspected activity titles, so allure.id traits on Swift Testing tests were dropped. Read the documentation field and extract allure.id:<n> into the AS_ID label using the same regex as the XCTest path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Swift Testing serializes parametrized test arguments into
ActionTestSummary.arguments._values[]. Each argument combination
produces a separate summary node with the same identifier, causing
all combos to share an identical historyId and collapse in Allure.
- Parse arguments._values[] into Allure Parameter objects
(name = parameter.label, value = value.description)
- Extend getHistoryId to append ordered argument values so each
combination gets a distinct, stable historyId
Gated on node.has("arguments") — XCTest and non-parametrized
Swift Testing tests are unaffected.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Jackson uses reflection to serialize allure-model POJOs. Parameter
was missing from the reflect-config, so its name/value fields were
inaccessible in the native binary and serialized as empty objects {}.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Swift Testing stores display names separately from function names: - @test("Example test name") -> ActionTestSummary.summary._value - @suite("Suite name") -> ActionTestSummaryGroup.summary._value Use summary as test name when present (fallback to function name for tests without a display name). Override suite label from the group's summary field so @suite display names appear in Allure. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Swift Testing serializes trait comments into
ActionTestSummary.documentation._values[].content._value, separately fromactivitySummaries. The existing parser only inspected activity titles (the XCTest path viaXCTContext.runActivity), soallure.idtraits on Swift Testing tests were silently dropped.This change reads the
documentationfield on each test summary and extractsallure.id:<n>into theAS_IDlabel using the same regex as the XCTest path. XCTest behavior is unchanged.Scope: only
allure.id. Otherallure.*patterns (name/description/label/link) are intentionally out of scope for this PR.Usage
Define a Swift Testing trait that wraps the id as a
Comment:Apply it to a test:
After running the test suite and exporting the xcresult:
xcresults export Test.xcresult ./allure-resultsThe resulting
*-result.jsonnow contains the AS_ID label:{ "name": "example()", "fullName": "SwiftRadioTests/example()", "labels": [ { "name": "AS_ID", "value": "1234" }, { "name": "suite", "value": "SwiftRadioTests" } ] }Test plan
.allureId(1234)—AS_ID=1234appears in the exported JSONXCTContext.runActivity(named: "allure.id:N")still produces the sameAS_IDlabel as before