I am trying to use codecov with my swift Xcode project. It was working fine until yesterday but is throwing error at llvm-cov show step in the bash uploader script today. Tried to replicate it with a basic xcode project setup in my local machine and still getting the same error.
Test session results, code coverage, and logs:
/Users/distiller/Library/Developer/Xcode/DerivedData/ClientRuntime-apczgcpmphxnwkcncwbtuklczvvo/Logs/Test/Test-ClientRuntime-2020.06.24_23-48-39-+0000.xcresult
** TEST SUCCEEDED **
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
Bash-20200622-40cebbd
==> Circle CI detected.
project root: /Users/distiller/project
--> token set from env
Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
==> Processing Xcode reports via llvm-cov
DerivedData folder: /Users/distiller/Library/Developer/Xcode/DerivedData
hint Speed up Swift processing by using use -J 'AppName' (regexp accepted)
hint This will remove Pods/ from your report. Also https://docs.codecov.io/docs/ignoring-paths
+ Building reports for ClientRuntime framework
No filenames specified!
x> llvm-cov failed to produce results for /Users/distiller/Library/Developer/Xcode/DerivedData/ClientRuntime-apczgcpmphxnwkcncwbtuklczvvo/Build/Products/Debug-iphonesimulator/ClientRuntime.framework/ClientRuntime
+ Building reports for ClientRuntimeTests xctest
No filenames specified!
x> llvm-cov failed to produce results for /Users/distiller/Library/Developer/Xcode/DerivedData/ClientRuntime-apczgcpmphxnwkcncwbtuklczvvo/Build/Products/Debug-iphonesimulator/ClientRuntimeTests.xctest/ClientRuntimeTests
-> Running gcov for Obj-C
==> Running gcov in /Users/distiller/project (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
+ /Users/distiller/project
-> Found 2 reports
==> Detecting git/mercurial file structure
==> Reading reports
- Skipping empty file /Users/distiller/project/smithy-swift/ClientRuntime/ClientRuntimeTests.xctest.coverage.txt
- Skipping empty file /Users/distiller/project/smithy-swift/ClientRuntime/ClientRuntime.framework.coverage.txt
--> No coverage data found.
Please visit http://docs.codecov.io/docs/supported-languages
search for your projects language to learn how to collect reports.
I got a chance to dive deep into the issue and realized that the bash script publicly available is broken. I am specifically referring to this line:
xcrun llvm-cov show “$beta_xcode_partials” -instr-profile “$1” “dest" > "_proj_name._type.coverage.txt" \
|| say " {r}x>${x} llvm-cov failed to produce results for $dest”
Turning ON the verbose mode shows that if we do not specify optional argument -X as xcodepartials, which I assume is a new beta feature added to the script, the above command translates to: xcrun llvm-cov show '' -instr-profile /Users/distiller/Library/Developer/Xcode/DerivedData/ClientRuntime-apczgcpmphxnwkcncwbtuklczvvo/Build/ProfileData/446FE82B-40CD-4DB0-96A8-45BBC702A68A/Coverage.profdata /Users/distiller/Library/Developer/Xcode/DerivedData/ClientRuntime-apczgcpmphxnwkcncwbtuklczvvo/Build/Products/Debug-iphonesimulator/ClientRuntime.framework/ClientRuntime
The empty single quotes passed as first argument to llvm-cov show is the undesired behavior.
Workaround:
If you don’t need the -X xcodepartials option(which I assume most people wont), then use: bash <(curl https://codecov.io/bash | sed 's/"$beta_xcode_partials"//g')
We are seeing the same issue in our repos. We have temp fixed it with the code snippet above. It would be great if you could deploy. It is basically a production outage of your ios test coverage.