a7ex / xcresultparser

Parse the binary xcresult bundle from Xcode builds and testruns
MIT License
98 stars 28 forks source link

Release: 1.6.0 #29

Closed Brett-Best closed 4 months ago

Brett-Best commented 4 months ago

I see that release/1.6.0 was merged into main - should a GitHub release + tag be made for it now?

Brett-Best commented 4 months ago

I gave it a quick spin by cloning it and it now errors when trying to generate the Cobertura code coverage with:

Error: dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON.", underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 "Number 18446744073709551432 is not representable in Swift." UserInfo={NSDebugDescription=Number 18446744073709551432 is not representable in Swift.})))

Works fine on 1.5.2, note is a mixed Objective C + Swift project

The error comes from FileCoverage.swift line 20:

let lineDetails = try container.decode([LineDetail].self, forKey: key)
a7ex commented 4 months ago

Good that I didn't make a release yet :-) Thanks for taking the time to test, Brett. That is very much appreciated. Looks like 18446744073709551432 is beyond the Max Integer :-) I might just need to convert it from Int to Double. Not sure where, however. Do you really have a xcresult, where one line is covered 18446744073709551432 times?

Brett-Best commented 4 months ago

Definitely not, I'm not sure where this number is coming from.

a7ex commented 4 months ago

That is really odd. If you can not send me the xcresult file in question for me to examine what's going on, please do the following: In the terminal run:

xcrun xccov view --archive --json <path-to-your-xcresult-bundle>

That should output JSON to your terminal. Can you search this JSON for "18446744073709551432"? I am really curious, where you have such a bug number? line, executionCount, column or length? All of these seem pretty unlikely to have such a big number.

Brett-Best commented 4 months ago

Will do would you be able to join https://ios-developers.io (Slack) or I can email it to you? https://join.slack.com/t/ios-developers/shared_invite/zt-27swvfuqf-Onx~Oaywirk6G1pkuJWrNQ

Brett-Best commented 4 months ago

Confirm that for a few files, that number does appear for the execution count in the JSON given by the command above.

a7ex commented 4 months ago

I created a new pull request which fixes the issue. You already tested it and so I'll close this issue now