Error processing reports with Jenkins

Description

When sending coverage reports to Jenkins I get the generic error response: " There was an error processing coverage reports."

Repository

Private repository

Versions

Newest version of Jenkins/Xcode

Additional Information

I am running my tests with Jenkins for my private iOS project. After the build I do:

curl -s https://codecov.io/bash | bash -s – -c -F unittests -J {PROJECT NAME} || echo “Codecov did not collect coverage reports”

In my console output in Jenkins I see:

e[0;90m->e[0m Uploading
e[0;31mX>e[0m Failed to upload
[0;90m->e[0m Sleeping for 30s and trying again…
[0;90m->e[0m Pinging Codecov

And eventually it responds with a 200 response. I have my token set in the codecov.yml which is detected by the system. Jenkins is reporting the build status correctly to GitHub and I’ve used codecov fine with Travis for open source projects before.

Hi @WyattMufson

I checked the raw report and it looks like there is something wrong with the path you gave the uploader. The only file it uploaded as “coverage” was a file named <redacted>.app.coverage.txt

In addition, it did not locate any directory named unittests

The best way to troubleshoot something like this is to add the -d flag and pipe the output to a file. This will output the report to stdout, instead of uploading it, and you can view what you are sending us to make sure it matches what you expect.

1 Like

Amazing, thank you. Will give that a try. Thanks for the detailed response.

1 Like

Why is it looking for a directory unittests? Shouldn’t -F be used to make a flag and not look for a file - wouldn’t that be -f?

I confused the flags, you are correct

1 Like

Do you have a more up to date example of how to use codecov with Jenkins?

Hi @WyattMufson

This project is using both Codecov and Jenkins: https://github.com/rapidsai/cudf

1 Like

I ran it with -d | cat at the end, and it printed out what looked like a coverage report (the files, and then the lines hit on each file).

Also, just make sure the output file type from Xcode/Jenkins is .xml else we can’t process the report. If .xccov, for example, you’ll need to convert using something like Slather: https://github.com/SlatherOrg/slather#usage-with-codecov

2 Likes

Aha that would most likely be the issue

So I think I’ve almost got it. I integrated Slather into Jenkins and am doing this now at the end of the build:

/usr/local/bin/slather
curl -s https://codecov.io/bash | bash -s – -f coverage-reports/cobertura.xml -X coveragepy -X gcov -X xcode -J {PROJECT} || echo “Codecov did not collect coverage reports”

It appears to upload the report successfully and the “Publish Cobertura Coverage Report” post-build action completes successfully (I can view coverage stats in Jenkins).

However, I still see the There was an error processing coverage reports. message.

@jerrod @drazisil any ideas? I feel like I’m pretty close to getting it

If you use the -d flag to dump the report, do the file paths in the overage match the paths in the network section? That’s the most common reason for that message, but if you can provide a full commit SHA I can take a look in the logs and database.

Last time I tried re-adding -d | cat it didn’t dump the report for some reason.

Here’s a commit SHA 1c7d128ff6402e9d80cf42c0d0791f7cc313fd58

WARNING No files found in report.

I’m not sure that slather is working, it looks like we are still getting source code instead of coverage data.

Interesting, let me work on it some more. Thanks for all of your help!

1 Like

Ok so I figured out an issue. I was missing a dash in the bash -s -- part. So now when I do it codecov detects the reports from slather. I still am seeing the error though in the dashboard. Here’s a commit SHA 70039c71f35d5cca0b34a8d371f8ceba602214a3

We’ve got coverage now, yay! The path=fixes section looks a bit odd though, if we had you add some, can you take them out? I think they aren’t needed.

What’s path=fixes? All I have is:

/usr/local/bin/slather coverage --jenkins
curl -s https://codecov.io/bash | bash -s -- -f coverage-reports/cobertura.xml -X coveragepy -X gcov -X xcode || echo “Codecov did not collect coverage reports”

Do you have a codecov.yml file?