Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.1.2 fails to find Xcode coverage files #16

Closed
ncreated opened this issue Oct 11, 2021 · 19 comments
Closed

3.1.2 fails to find Xcode coverage files #16

ncreated opened this issue Oct 11, 2021 · 19 comments

Comments

@ncreated
Copy link

ncreated commented Oct 11, 2021

馃憢 We're using 3.1.2 to upload coverage data from our project. After running tests with xcode-test, the codecov-bitrise fails with:

['error'] There was an error running the uploader: No coverage files located, please try use `-f`, or change the project root with `-R`

I expect that running codecov step after xcode-test step (with generate_code_coverage_files: 'yes') should be enough to have coverage data uploaded to codecov.io. Instead, it fails even in minimal setup.

It is very much unclear to me how to proceed further, as for what I see the codecov-bitrise step uses the new uploader, which unlike the old, and deprecated bash uploader does not support Xcode coverage files. There seems to be nothing I can do to address the error, unless I write my own exporter of Xcode coverage data to the format that works with the new uploader 馃槥.

How can we use codecov-bitrise step to find and upload our Xcode coverage data?


Our setup in bitrise.yml:

    - xcode-test:
        title: Run unit tests for Datadog - iOS Simulator
        inputs:
        - scheme: Datadog
        - simulator_device: iPhone 11
        - generate_code_coverage_files: 'yes'
        - project_path: Datadog.xcworkspace
    - codecov@3.1.2:
        title: Send coverage report for `Datadog`
        run_if: .IsCI
        inputs:
        - CODECOV_TOKEN: ${CODECOV_TOKEN}
        - OS: macos

Important part of the CI log:

+------------------------------------------------------------------------------+
| (1) Send coverage report for `Datadog`                                       |
+------------------------------------------------------------------------------+
| id: codecov                                                                  |
| version: 3.1.2                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: bash                                                                |
| time: 2021-10-11T10:43:44Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0gpg: directory '/Users/vagrant/.gnupg' created
gpg: keybox '/Users/vagrant/.gnupg/trustedkeys.gpg' created

100  3187  100  3187    0     0   9776      0 --:--:-- --:--:-- --:--:--  9776
gpg: /Users/vagrant/.gnupg/trustdb.gpg: trustdb created
...
gpgv: Good signature from "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>"
codecov: OK
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   642  100   642    0     0   5055      0 --:--:-- --:--:-- --:--:--  5055
"version":"v0.1.5"
[2021-10-11T10:43:47.577Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/
  Codecov report uploader 0.1.5
[2021-10-11T10:43:47.636Z] ['info'] => Project root located at: /Users/vagrant/git
[2021-10-11T10:43:47.640Z] ['info'] ->  Token found by environment variables
[2021-10-11T10:43:47.650Z] ['info'] Searching for coverage files...
[2021-10-11T10:43:47.751Z] ['error'] There was an error running the uploader: No coverage files located, please try use `-f`, or change the project root with `-R`
WARN[10:43:47] Step (Send coverage report for `Datadog`) failed, but was marked as skippable 
@thomasrockhu
Copy link
Contributor

@eliatcodecov

@thomasrockhu-codecov
Copy link
Contributor

Hi @ncreated, just out of curiosity, have you been able to get this to work previously?

@ncreated
Copy link
Author

Hi @ncreated, just out of curiosity, have you been able to get this to work previously?

Hi @thomasrockhu-codecov 馃憢. No, we were not using Codecov before. We are adding this integration now, but struggling with above issue.

What works fine is using deprecated Bash uploader directly in our repo (without using codecov-bitrise). For what I see, older versions of codecov-bitrise do use it, so they would perhaps work.

@thomasrockhu
Copy link
Contributor

@ncreated would you be able to supply the output of the bash uploader here?

@ncreated
Copy link
Author

@ncreated would you be able to supply the output of the bash uploader here?

Turns out I made a try with codecov-bitrise 2.0.2 (it uses Bash uploader) few days ago. It worked successfully:

Screenshot 2021-10-13 at 09 44 43

Bitrise log from uploading with 2.0.2:

+------------------------------------------------------------------------------+
| (1) Send coverage report for `Datadog`                                       |
+------------------------------------------------------------------------------+
| id: codecov                                                                  |
| version: 2.0.2                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: bash                                                                |
| time: 2021-10-05T14:26:11Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
Unknown option: ignore-missing
Type shasum -h for help
(23) Failed writing body
codecov: OK
Unknown option: ignore-missing
Type shasum -h for help
(23) Failed writing body
codecov: OK
Unknown option: ignore-missing
Type shasum -h for help
(23) Failed writing body
codecov: OK
./codecov: option requires an argument -- C
  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                              Bash-1.0.6
==> git version 2.33.0 found
==> curl 7.64.1 (x86_64-apple-darwin19.0) libcurl/7.64.1 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.39.2
Release-Date: 2019-03-27
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS GSS-API HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL UnixSockets
==> Bitrise CI detected.
    current dir:  /Users/vagrant/git
    project root: .
--> token set from env
    Yaml found at: .codecov.yml
==> Processing Xcode reports via llvm-cov
    DerivedData folder: /Users/vagrant/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 Example app
    + Building reports for CrashReporter framework
error: /Users/vagrant/Library/Developer/Xcode/DerivedData/Datadog-ckswydpbewsqmvefiflmhlznoqtj/Build/Products/Debug-iphonesimulator/CrashReporter.framework/CrashReporter: Failed to load coverage: Unknown architecture named: 
    x> llvm-cov failed to produce results for /Users/vagrant/Library/Developer/Xcode/DerivedData/Datadog-ckswydpbewsqmvefiflmhlznoqtj/Build/Products/Debug-iphonesimulator/CrashReporter.framework/CrashReporter
    + Building reports for Datadog framework
    + Building reports for DatadogCrashReporting framework
    + Building reports for XCTAutomationSupport framework
error: /Users/vagrant/Library/Developer/Xcode/DerivedData/Datadog-ckswydpbewsqmvefiflmhlznoqtj/Build/Products/Debug-iphonesimulator/Example.app/Frameworks/XCTAutomationSupport.framework/XCTAutomationSupport: Failed to load coverage: Unknown architecture named: 
    x> llvm-cov failed to produce results for /Users/vagrant/Library/Developer/Xcode/DerivedData/Datadog-ckswydpbewsqmvefiflmhlznoqtj/Build/Products/Debug-iphonesimulator/Example.app/Frameworks/XCTAutomationSupport.framework/XCTAutomationSupport
    + Building reports for XCTest framework
error: /Users/vagrant/Library/Developer/Xcode/DerivedData/Datadog-ckswydpbewsqmvefiflmhlznoqtj/Build/Products/Debug-iphonesimulator/Example.app/Frameworks/XCTest.framework/XCTest: Failed to load coverage: Unknown architecture named: 
    x> llvm-cov failed to produce results for /Users/vagrant/Library/Developer/Xcode/DerivedData/Datadog-ckswydpbewsqmvefiflmhlznoqtj/Build/Products/Debug-iphonesimulator/Example.app/Frameworks/XCTest.framework/XCTest
    + Building reports for Datadog framework
    + Building reports for DatadogCrashReporting framework
    + Building reports for Kronos framework
error: /Users/vagrant/Library/Developer/Xcode/DerivedData/Datadog-ckswydpbewsqmvefiflmhlznoqtj/Build/Products/Debug-iphonesimulator/Example.app/Frameworks/Kronos.framework/Kronos: Failed to load coverage: Unknown architecture named: 
    x> llvm-cov failed to produce results for /Users/vagrant/Library/Developer/Xcode/DerivedData/Datadog-ckswydpbewsqmvefiflmhlznoqtj/Build/Products/Debug-iphonesimulator/Example.app/Frameworks/Kronos.framework/Kronos
    + Building reports for DatadogObjc framework
    + Building reports for Kronos framework
error: /Users/vagrant/Library/Developer/Xcode/DerivedData/Datadog-ckswydpbewsqmvefiflmhlznoqtj/Build/Products/Debug-iphonesimulator/Kronos.framework/Kronos: Failed to load coverage: Unknown architecture named: 
    x> llvm-cov failed to produce results for /Users/vagrant/Library/Developer/Xcode/DerivedData/Datadog-ckswydpbewsqmvefiflmhlznoqtj/Build/Products/Debug-iphonesimulator/Kronos.framework/Kronos
    + Building reports for DatadogObjc framework
    + Building reports for DatadogTests xctest
    -> Running gcov for Obj-C
Example/Scenarios/URLSession/NSURLSessionAutoInstrumentation/ObjcSendFirstPartyRequestsViewController.m: No such file or directory
Example/Scenarios/CrashReporting/CrashReporting/CrashReportingObjcHelpers.m: No such file or directory
Example/Scenarios/URLSession/NSURLSessionAutoInstrumentation/ObjcSendThirdPartyRequestsViewController.m: No such file or directory
File '/Users/vagrant/git/Sources/_Datadog_Private/ObjcAppLaunchHandler.m'
Lines executed:94.44% of 36
/Users/vagrant/git/Sources/_Datadog_Private/ObjcAppLaunchHandler.m:creating '#Users#vagrant#git#Sources#_Datadog_Private#ObjcAppLaunchHandler.m.gcov'
File '/Users/vagrant/git/Sources/_Datadog_Private/ObjcExceptionHandler.m'
Lines executed:100.00% of 9
/Users/vagrant/git/Sources/_Datadog_Private/ObjcExceptionHandler.m:creating '#Users#vagrant#git#Sources#_Datadog_Private#ObjcExceptionHandler.m.gcov'
File 'Example/Scenarios/URLSession/NSURLSessionAutoInstrumentation/ObjcSendFirstPartyRequestsViewController.m'
Lines executed:0.00% of 33
Example/Scenarios/URLSession/NSURLSessionAutoInstrumentation/ObjcSendFirstPartyRequestsViewController.m:creating 'Example#Scenarios#URLSession#NSURLSessionAutoInstrumentation#ObjcSendFirstPartyRequestsViewController.m.gcov'
File 'Example/Scenarios/CrashReporting/CrashReporting/CrashReportingObjcHelpers.m'
Lines executed:0.00% of 8
Example/Scenarios/CrashReporting/CrashReporting/CrashReportingObjcHelpers.m:creating 'Example#Scenarios#CrashReporting#CrashReporting#CrashReportingObjcHelpers.m.gcov'
File 'Example/Scenarios/URLSession/NSURLSessionAutoInstrumentation/ObjcSendThirdPartyRequestsViewController.m'
Lines executed:0.00% of 22
Example/Scenarios/URLSession/NSURLSessionAutoInstrumentation/ObjcSendThirdPartyRequestsViewController.m:creating 'Example#Scenarios#URLSession#NSURLSessionAutoInstrumentation#ObjcSendThirdPartyRequestsViewController.m.gcov'
File '/Users/vagrant/git/Tests/DatadogTests/DatadogObjc/ObjcAPITests/DDGlobal+apiTests.m'
Lines executed:100.00% of 8
/Users/vagrant/git/Tests/DatadogTests/DatadogObjc/ObjcAPITests/DDGlobal+apiTests.m:creating '#Users#vagrant#git#Tests#DatadogTests#DatadogObjc#ObjcAPITests#DDGlobal+apiTests.m.gcov'
File '/Users/vagrant/git/Tests/DatadogTests/TestsObserver/DatadogTestsObserverLoader.m'
Lines executed:100.00% of 3
/Users/vagrant/git/Tests/DatadogTests/TestsObserver/DatadogTestsObserverLoader.m:creating '#Users#vagrant#git#Tests#DatadogTests#TestsObserver#DatadogTestsObserverLoader.m.gcov'
File '/Users/vagrant/git/Tests/DatadogTests/DatadogObjc/ObjcAPITests/DDRUMMonitor+apiTests.m'
Lines executed:100.00% of 42
/Users/vagrant/git/Tests/DatadogTests/DatadogObjc/ObjcAPITests/DDRUMMonitor+apiTests.m:creating '#Users#vagrant#git#Tests#DatadogTests#DatadogObjc#ObjcAPITests#DDRUMMonitor+apiTests.m.gcov'
File '/Users/vagrant/git/Tests/DatadogTests/DatadogObjc/ObjcAPITests/DDConfiguration+apiTests.m'
Lines executed:81.67% of 60
/Users/vagrant/git/Tests/DatadogTests/DatadogObjc/ObjcAPITests/DDConfiguration+apiTests.m:creating '#Users#vagrant#git#Tests#DatadogTests#DatadogObjc#ObjcAPITests#DDConfiguration+apiTests.m.gcov'
File '/Users/vagrant/git/Tests/DatadogTests/Helpers/NSURLSessionBridge.m'
Lines executed:100.00% of 15
/Users/vagrant/git/Tests/DatadogTests/Helpers/NSURLSessionBridge.m:creating '#Users#vagrant#git#Tests#DatadogTests#Helpers#NSURLSessionBridge.m.gcov'
File '/Users/vagrant/git/Tests/DatadogTests/DatadogObjc/ObjcAPITests/DDNSURLSessionDelegate+apiTests.m'
Lines executed:100.00% of 4
/Users/vagrant/git/Tests/DatadogTests/DatadogObjc/ObjcAPITests/DDNSURLSessionDelegate+apiTests.m:creating '#Users#vagrant#git#Tests#DatadogTests#DatadogObjc#ObjcAPITests#DDNSURLSessionDelegate+apiTests.m.gcov'
File '/Users/vagrant/git/Tests/DatadogTests/DatadogObjc/ObjcAPITests/DDDatadog+apiTests.m'
Lines executed:100.00% of 20
/Users/vagrant/git/Tests/DatadogTests/DatadogObjc/ObjcAPITests/DDDatadog+apiTests.m:creating '#Users#vagrant#git#Tests#DatadogTests#DatadogObjc#ObjcAPITests#DDDatadog+apiTests.m.gcov'
File '/Users/vagrant/git/Tests/DatadogTests/Helpers/CustomObjcViewController.m'
Lines executed:0.00% of 3
/Users/vagrant/git/Tests/DatadogTests/Helpers/CustomObjcViewController.m:creating '#Users#vagrant#git#Tests#DatadogTests#Helpers#CustomObjcViewController.m.gcov'
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
    + .
    -> Found 22 reports
==> Detecting git/mercurial file structure
==> Reading reports
    + ./#Users#vagrant#git#Tests#DatadogTests#TestsObserver#DatadogTestsObserverLoader.m.gcov bytes=1537
    + ./Example#Scenarios#URLSession#NSURLSessionAutoInstrumentation#ObjcSendFirstPartyRequestsViewController.m.gcov bytes=1994
    + ./Example.app.coverage.txt bytes=132847
    + ./#Users#vagrant#git#Tests#DatadogTests#DatadogObjc#ObjcAPITests#DDNSURLSessionDelegate+apiTests.m.gcov bytes=1926
    - Skipping empty file ./XCTAutomationSupport.framework.coverage.txt
    + ./Datadog.framework.coverage.txt bytes=920844
    + ./#Users#vagrant#git#Tests#DatadogTests#DatadogObjc#ObjcAPITests#DDRUMMonitor+apiTests.m.gcov bytes=5695
    + ./#Users#vagrant#git#Tests#DatadogTests#DatadogObjc#ObjcAPITests#DDDatadog+apiTests.m.gcov bytes=2941
    + ./#Users#vagrant#git#Tests#DatadogTests#Helpers#NSURLSessionBridge.m.gcov bytes=2160
    - Skipping empty file ./Kronos.framework.coverage.txt
    + ./Example#Scenarios#CrashReporting#CrashReporting#CrashReportingObjcHelpers.m.gcov bytes=1096
    + ./#Users#vagrant#git#Sources#_Datadog_Private#ObjcExceptionHandler.m.gcov bytes=1670
    + ./Example#Scenarios#URLSession#NSURLSessionAutoInstrumentation#ObjcSendThirdPartyRequestsViewController.m.gcov bytes=1658
    + ./#Users#vagrant#git#Tests#DatadogTests#Helpers#CustomObjcViewController.m.gcov bytes=1378
    + ./#Users#vagrant#git#Tests#DatadogTests#DatadogObjc#ObjcAPITests#DDConfiguration+apiTests.m.gcov bytes=6545
    + ./#Users#vagrant#git#Tests#DatadogTests#DatadogObjc#ObjcAPITests#DDGlobal+apiTests.m.gcov bytes=1745
    - Skipping empty file ./CrashReporter.framework.coverage.txt
    + ./DatadogTests.xctest.coverage.txt bytes=1551923
    + ./DatadogCrashReporting.framework.coverage.txt bytes=48618
    + ./#Users#vagrant#git#Sources#_Datadog_Private#ObjcAppLaunchHandler.m.gcov bytes=5371
    + ./DatadogObjc.framework.coverage.txt bytes=180461
    - Skipping empty file ./XCTest.framework.coverage.txt
==> Appending adjustments
    https://docs.codecov.io/docs/fixing-reports
    + Found adjustments
==> Gzipping contents
        540K	/tmp/codecov.xZyXTy.gz
==> Uploading reports
    url: https://codecov.io
    query: branch=ncreated%2FRUMM-383-send-tests-coverage-to-PRs&commit=5a6a5192b2bf15f9c204d95b755cf52eb57a48fa&build=7735&build_url=https%3A%2F%2Fapp.bitrise.io%2Fbuild%2Fae6f8cf6-029c-4532-bb15-3b41603dca14&name=&tag=&slug=DataDog%2Fdd-sdk-ios&service=bitrise&flags=&pr=&job=&cmd_args=Q,Z,?
->  Pinging Codecov
https://codecov.io/upload/v4?package=bitrise-step-1.0.6&token=[REDACTED]&package=bitrise-step-1.0.6&token=[REDACTED]&branch=ncreated%2FRUMM-383-send-tests-coverage-to-PRs&commit=5a6a5192b2bf15f9c204d95b755cf52eb57a48fa&build=7735&build_url=https%3A%2F%2Fapp.bitrise.io%2Fbuild%2Fae6f8cf6-029c-4532-bb15-3b41603dca14&name=&tag=&slug=DataDog%2Fdd-sdk-ios&service=bitrise&flags=&pr=&job=&cmd_args=Q,Z,?
->  Uploading to
https://storage.googleapis.com/codecov/v4/raw/2021-10-05/[REDACTED]
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  539k    0     0  100  539k      0  1466k --:--:-- --:--:-- --:--:-- 1462k
100  539k    0     0  100  539k      0  1309k --:--:-- --:--:-- --:--:-- 1306k
    -> Reports have been successfully queued for processing at https://codecov.io/github/DataDog/dd-sdk-ios/commit/5a6a5192b2bf15f9c204d95b755cf52eb57a48fa

However, then I tried customizing this codecov report by leveraging -J and -F flags, which failed on 2.0.2:

# bitrise.yml:
        - other_options: "-C $BITRISE_GIT_COMMIT -J 'DatadogObjc' -F DatadogObjc"

# Bitrise log:
->  Pinging Codecov
https://codecov.io/upload/v4?package=bitrise-step-1.0.6&token=[REDACTED]&package=bitrise-step-1.0.6&token=[REDACTED]&branch=ncreated%2FRUMM-383-send-tests-coverage-to-PRs&commit=-J&build=7736&build_url=https%3A%2F%2Fapp.bitrise.io%2Fbuild%2Ff0b8e6fc-a055-4f6a-9707-0178395649a6&name=&tag=&slug=DataDog%2Fdd-sdk-ios&service=bitrise&flags=&pr=&job=&cmd_args=Q,Z,C
Invalid request parameters
400
WARN[14:52:52] Step (Send coverage report for `Datadog`) failed, but was marked as skippable 

I can see in this log that other_options were badly parsed, leading to building &commit=-J& query.

@thomasrockhu-codecov
Copy link
Contributor

@ncreated looping this into codecov/uploader#223, sorry for the delay in getting back a response to you.

@dmiluski
Copy link

dmiluski commented Jan 26, 2022

Hi folks, anybody else still experiencing this?

We've had Codecov tool disabled since leak this past year and I wanted to check if this step was still supported?

I'm using latest XcodeTest for iOS (4.x.x), CodeCov (3.x.x)

If I look at my artifacts, I see:

  • Test.xcreport.zip (Contains Build, Coverage, Log)
  • xcode-test-results-Straightaway.html
+------------------------------------------------------------------------------+

| (11) codecov@3                                                               |
+------------------------------------------------------------------------------+
| id: codecov                                                                  |
| version: 3.1.2                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: bash                                                                |
| time: 2022-01-26T22:45:09Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0gpg: directory '/Users/vagrant/.gnupg' created
gpg: keybox '/Users/vagrant/.gnupg/trustedkeys.gpg' created

100  3187  100  3187    0     0  23892      0 --:--:-- --:--:-- --:--:-- 26122
gpg: /Users/vagrant/.gnupg/trustdb.gpg: trustdb created
gpg: key 806BB28AED779869: public key "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpgv: can't allocate lock for '/Users/vagrant/.gnupg/trustedkeys.gpg'
gpgv: Signature made Wed Jan 26 18:08:36 2022 GMT
gpgv:                using RSA key 27034E7FDB850E0BBC2C62FF806BB28AED779869
gpgv: Good signature from "Codecov Uploader (Codecov Uploader Verification Key) <security@codecov.io>"
codecov: OK
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   650  100   650    0     0  13835      0 --:--:-- --:--:-- --:--:-- 17567
"version":"v0.1.15"
[2022-01-26T22:45:11.631Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/
  Codecov report uploader 0.1.15
[2022-01-26T22:45:11.674Z] ['info'] => Project root located at: /Users/vagrant/git
[2022-01-26T22:45:11.678Z] ['info'] ->  Token found by environment variables
[2022-01-26T22:45:11.693Z] ['info'] Searching for coverage files...
[2022-01-26T22:45:11.760Z] ['info'] Warning: Some files located via search were excluded from upload.
[2022-01-26T22:45:11.760Z] ['info'] If Codecov did not locate your files, please review https://docs.codecov.com/docs/supported-report-formats
[2022-01-26T22:45:11.760Z] ['error'] There was an error running the uploader: No coverage files located, please try use `-f`, or change the project root with `-R`
WARN[22:45:11] Step (codecov@3) failed, but was marked as skippable 
|                                                                              |
+---+---------------------------------------------------------------+----------+
| ! | codecov@3 (exit code: 255)                                    | 3.98 sec |
+---+---------------------------------------------------------------+----------+
| Issue tracker: https://community.codecov.io                                  |
| Source: https://github.com/codecov/codecov-bitrise                           |
+---+---------------------------------------------------------------+----------+

@liamnichols
Copy link

I'm a bit out of the loop because we're trying to use Codecov for the first time today, but it seems like the new uploader (used by 3.x of this step) does not support Xcode, and the old uploader (2.x) was deprecated this month.

Do I understand correctly that this means that we can't use the step for iOS projects? Is there an intermediate solution?

@thomasrockhu
Copy link
Contributor

@liamnichols, to summarize, 3.x doesn't yet support Xcode but is being worked on by the team currently. A possible solution is to run something like

swift package generate-xcodeproj
xcodebuild -scheme CombineCloudKit-Package -destination 'id=529F3FC8-EB55-4644-A1B3-01FF1DA6A2BA' -resultBundlePath foo.xcresult -enableCodeCoverage YES test
cd ../xcode-poc/
node generate-codecov-json.js --archive-path ../CombineCloudKit/foo.xcresult/

from this comment before the step.

@callumboddy-collecting
Copy link

@thomasrockhu Do you have an progress update for this?

@thomasrockhu-codecov
Copy link
Contributor

@callumboddy-collecting sorry I don't have a solid update. I'm hoping that we'll have something by EOM

@callumboddy-collecting
Copy link

callumboddy-collecting commented Apr 8, 2022

@thomasrockhu-codecov all good, thank you. looking forward to getting this integration up and running.

@thomasrockhu-codecov
Copy link
Contributor

@callumboddy-collecting we released a new version of the underlying uploader that hopefully makes some progress here. you should be able to add --xc --xp {{ archive_path }} as OTHER_OPTIONS in your bitrise.yml

I'm not particularly well-versed in xcode development nor bitrise, but if I can help and/or if your project is public, I'd like to be involved with making sure it works fo ryou.

@callumboddy-collecting
Copy link

Hi @thomasrockhu-codecov, thanks for the update. I'll give this a go and get back to you. Our repo is private.

@holyavkin
Copy link

holyavkin commented May 3, 2022

Hey, @thomasrockhu-codecov your solution works. Thanks!

The only issue I have with it is the processing time.
First I thought it just stuck on on 'Running xcode coversion' step.

However, when I added -v (verbose) flag into other flags, I found it did go through each source file to convert.
It took an extra 16 minutes to convert all files and create a coverage .json file.

If I do it via solution from here it takes 8 minutes only.

Is there any way to optimize this conversion process?

@holyavkin
Copy link

For future references who struggle to make it work - add it to bitrise.yml after xcode-test step:

    - codecov@3:
        inputs:
        - OS: macos
        - other_options: -v -C $GIT_CLONE_COMMIT_HASH --xc --xp $BITRISE_XCRESULT_PATH
        - CODECOV_TOKEN: $CODECOV_TOKEN

@thomasrockhu-codecov
Copy link
Contributor

@holyavkin I'm going to try to make an improvement to the step so that it doesn't have to be as clunky as the bitrise.yml you pasted. Thanks for adding that, btw!

#19

@thomasrockhu-codecov
Copy link
Contributor

@holyavkin I don't want to lose track of the comment you wrote about longer processing times. Are you able to share logs in this community post

@thomasrockhu-codecov
Copy link
Contributor

Closing this issue as it seems to be resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants