Repository navigation
Fix: support xcresult node types - #503
Conversation
priitlatt
left a comment
There was a problem hiding this comment.
Outputs of xcrun xcresulttool get test-results summary --schema on Xcode 26.2 and Xcode 27.0:
And their diff
57c57,66
< "$ref": "#/schemas/TestFailure"
---
> "type": "array",
> "items": {
> "$ref": "#/schemas/TestFailure"
> }
> },
> "runtimeWarnings": {
> "type": "array",
> "items": {
> "$ref": "#/schemas/Issue"
> }
72c81,82
< "testFailures"
---
> "testFailures",
> "runtimeWarnings"
229a240,263
> },
> "Issue": {
> "type": "object",
> "properties": {
> "issueType": {
> "type": "string"
> },
> "message": {
> "type": "string"
> },
> "targetName": {
> "type": "string"
> },
> "sourceURL": {
> "type": "string"
> },
> "className": {
> "type": "string"
> }
> },
> "required": [
> "issueType",
> "message"
> ]Similarly, outputs of xcrun xcresulttool get test-results tests --schema on Xcode 26.2 and Xcode 27.0:
And their diff
84a85,87
> "nodeIdentifierURL": {
> "type": "string"
> },
111a115,117
> "sourceLocation": {
> "$ref": "#/schemas/SourceLocation"
> },
152c158,160
< "Runtime Warning"
---
> "Runtime Warning",
> "Skip Message",
> "Expected Failure"
153a162,176
> },
> "SourceLocation": {
> "type": "object",
> "properties": {
> "filePath": {
> "type": "string"
> },
> "lineNumber": {
> "type": "integer"
> }
> },
> "required": [
> "filePath",
> "lineNumber"
> ]Note that schemas are identical on Xcode versions 27.0, 27.1 and 27.2.
From the above diffs we can see that in addition to the crash patch there are some missing parts that we're currently not modeling in any way:
Summary.runtimeWarnings: [Issue]is missing fromXcSummaryTestNode.sourceLocationis missing fromXcTestNode. Various Junit XML implementations support both file and line refs, see nextest-rs/nextest#2420 for example.TestNode.nodeIdentifierURLis missing fromXcTestNode.
What are the plans with missing data that is present in the new schema?
|
This PR is a great reminder that we should get rid of |
|
Thanks for sharing schema notes diff.
I propose to keep the new fields out of the scope of this PR. It seems like they don't break parsing. Happy to follow up separately. |
Co-authored-by: Priit Lätt <lattpriit@gmail.com>
xcresulttooltest-results schema 0.2.0 (default on Xcode 27) adds XCTest node typesExpected FailureandSkip Message. Neither was supported inXcTestNodeType, so parsing failed when such a node was present in a*.xcresultbundle (e.g. fromXCTExpectFailure/XCTSkip):Summary
Expected FailureandSkip MessageXCTest node types from xcresulttool schema 0.2.0+Skip Messagechildren (still support Xcode 16Failure Message+result=Skipped); dedupe identical messages from both sources<error>when a test case also has a real failureXCTExpectFailurereason text in JUnit<system-out>for expected failures, including failed cases that also have expected failures (not only whenstatus="Expected Failure")Out of scope
Additive schema fields (
runtimeWarnings,sourceLocation,nodeIdentifierURL) are ignored by ourfrom_dictpaths and are not modeled in this PR.Codemagic builder/UI does not yet map
@status="Expected Failure"/<system-out>(expected failures still show as passes in the overview until a follow-up).QA
Failure Message+result=Skippedstill works (unit test)_get_test_case_erroron mixed fail cases (unit test)status+<system-out>as intended (unit + least)<skipped message="...">Xcode app tests
JUnit from Xcode app tests
Build: 6ac49e8084481fd34b0c621c — convert succeeded; build failed intentionally on mixed probe (exit 65). Artifact:
test-reports/test-results.xml.@statustestExpectedFailure()Expected Failure<system-out>known bad assertion</system-out>testExpectedFailureThenRealFailure()Failed<error message="XCTAssertEqual failed: ("3") is not equal to ("4") - should be real failure" type="Failure"/>+<system-out>known bad assertion</system-out>testPass()PassedtestSkip()Skipped<skipped message="Test skipped - skipping on purpose"/>Details about schema changes in 0.2.0+