realm / SwiftLint

A tool to enforce Swift style and conventions.
https://realm.github.io/SwiftLint
MIT License
18.67k stars 2.22k forks source link

Code coverage is broken - is only shown for test targets #5026

Open mildm8nnered opened 1 year ago

mildm8nnered commented 1 year ago

New Issue Checklist

Describe the bug

When I enable code coverage in the swiftlint scheme, I only get coverage data for the test targets.

Steps to replicate:

1) Open SwiftLint in Xcode 2) Edit Scheme -> Test -> Options - enable code coverage 3) Switch to the Test Navigator (Command-6) 4) Run the Generated Tests 5) Switch to the Report Navigator (Command-9), and select the latest Coverage report

Observed: Only coverage data for the test targets is shown Expected: Coverage data for all targets should be displayed (and by default, test targets should be excluded).

Not sure exactly when this broke - possibly during the recent re-organization.

Screenshot 2023-05-21 at 09 28 55
Complete output when running SwiftLint, including the stack trace and command used

N/A

Environment

N/A

No

Xcode 14.2 Build version 14C18

N/A

mildm8nnered commented 7 months ago

xcrun llvm-cov report ./Build/Products/Debug/swiftlint -instr-profile ./Build/ProfileData/B0BFD85A-E8E4-510B-B453-151468BBD21C/Coverage.profdata produces sensible output ...

mildm8nnered commented 3 months ago

Any thoughts on this @SimplyDanny @jpsim - I would love to have code coverage working - I find it really useful in detail to make sure that I have good test coverage of specific code branches - I don't care about the headline numbers much per se.

SimplyDanny commented 3 months ago

I cannot say much about Xcode. For about half a year, I've worked on SwiftLint in VS Code only. The Swift extension got very good and is getting regular updates due to Apple now also investing in it. Especially coverage works quite well.

mildm8nnered commented 3 months ago

I cannot say much about Xcode. For about halt a year, I've worked on SwiftLint in VS Code only. The Swift extension got very good and is getting regular updates due to Apple now also investing in it.

Believe me no-one hates Xcode more than I do.

Especially coverage works quite well.

That's just rubbing salt in the wound :-)

I guess I'll just try to dig in some more. Coverage definitely worked at one point.