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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload is empty #844

Closed
AllanOricil opened this issue Oct 3, 2022 · 38 comments
Closed

upload is empty #844

AllanOricil opened this issue Oct 3, 2022 · 38 comments

Comments

@AllanOricil
Copy link

AllanOricil commented Oct 3, 2022

Github Action logs say that the coverage file was found and uploaded successfuly

image

2022-10-03T01:29:11.0800591Z ##[group]Run codecov/codecov-action@v3
2022-10-03T01:29:11.0801049Z with:
2022-10-03T01:29:11.0801486Z   token: ***
2022-10-03T01:29:11.0801817Z   flags: APEX
2022-10-03T01:29:11.0802242Z   directory: ./dist/***/tests/coverage/
2022-10-03T01:29:11.0802656Z ##[endgroup]
2022-10-03T01:29:11.0810404Z ##[command]/usr/bin/docker exec  712d1bb81dc64352f91821c86f6225d19b290270aea97fc71afa3a816f063a40 sh -c "cat /etc/*release | grep ^ID"
2022-10-03T01:29:11.4118183Z ==> linux OS detected
2022-10-03T01:29:12.0198330Z https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
2022-10-03T01:29:12.1764327Z ==> SHASUM file signed by key id 806bb28aed779869
2022-10-03T01:29:12.3434373Z ==> Uploader SHASUM verified (20f9c9d78483fce977b6cc39e231a734a23bcd36f4d536bb7355222fb88d02bc  codecov)
2022-10-03T01:29:12.3436992Z ==> Running version latest
2022-10-03T01:29:12.4614124Z ==> Running version v0.3.2
2022-10-03T01:29:12.4636906Z [command]/__w/_actions/codecov/codecov-action/v3/dist/codecov -n  -Q github-action-3.1.1 -F APEX -s ./dist/***/tests/coverage/
2022-10-03T01:29:12.6796418Z [2022-10-03T01:29:12.677Z] ['info'] 
2022-10-03T01:29:12.6796861Z      _____          _
2022-10-03T01:29:12.6797215Z     / ____|        | |
2022-10-03T01:29:12.6797935Z    | |     ___   __| | ___  ___ _____   __
2022-10-03T01:29:12.6798319Z    | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
2022-10-03T01:29:12.6798724Z    | |___| (_) | (_| |  __/ (_| (_) \ V /
2022-10-03T01:29:12.6799113Z     \_____\___/ \__,_|\___|\___\___/ \_/
2022-10-03T01:29:12.6799340Z 
2022-10-03T01:29:12.6799533Z   Codecov report uploader 0.3.2
2022-10-03T01:29:12.6849370Z [2022-10-03T01:29:12.684Z] ['info'] => Project root located at: /__w/sf-metadata/sf-metadata
2022-10-03T01:29:12.6880866Z [2022-10-03T01:29:12.687Z] ['info'] ->  Token found by environment variables
2022-10-03T01:29:12.7418822Z [2022-10-03T01:29:12.741Z] ['info'] Searching for coverage files...
2022-10-03T01:29:12.8225394Z [2022-10-03T01:29:12.821Z] ['info'] Warning: Some files located via search were excluded from upload.
2022-10-03T01:29:12.8235193Z [2022-10-03T01:29:12.823Z] ['info'] If Codecov did not locate your files, please review https://docs.codecov.com/docs/supported-report-formats
2022-10-03T01:29:12.8243267Z [2022-10-03T01:29:12.823Z] ['info'] => Found 1 possible coverage files:
2022-10-03T01:29:12.8243718Z   coverage.json
2022-10-03T01:29:12.8249842Z [2022-10-03T01:29:12.824Z] ['info'] Processing dist/***/tests/coverage/coverage.json...
2022-10-03T01:29:12.8709496Z [2022-10-03T01:29:12.870Z] ['info'] Detected GitHub Actions as the CI provider.
2022-10-03T01:29:12.8741199Z [2022-10-03T01:29:12.873Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-3.1.1-uploader-0.3.2&token=*******&branch=main&build=3170833532&build_url=https%3A%2F%2Fgithub.com%2FVodafoneIS%2Fsf-metadata%2Factions%2Fruns%2F3170833532&commit=8c35496b53791129326ba79c86a04d76419f0837&job=Deploy+to+***+Workflow&pr=&service=github-actions&slug=VodafoneIS%2Fsf-metadata&name=&tag=&flags=APEX&parent=
2022-10-03T01:29:13.9643393Z [2022-10-03T01:29:13.962Z] ['info'] https://app.codecov.io/github/VodafoneIS/sf-metadata/commit/8c35496b53791129326ba79c86a04d76419f0837
2022-10-03T01:29:13.9645638Z https://storage.googleapis.com/codecov/v4/raw/2022-10-03/DBC2BB2F6B0EDDBF65CAE4F7B9611B25/8c35496b53791129326ba79c86a04d76419f0837/94f5a92b-d96e-4c83-8804-47bc216a536b.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EJOGFN2JQ4OCTGA2MU5AEIT7OT5Z7HTFOAN2SPG4NWSN2UJYOY5U6LZQ%2F20221003%2FUS%2Fs3%2Faws4_request&X-Amz-Date=20221003T012913Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=7e53421697ed9b5dee251c87474ec31ec56b6009d42ee9bc1725b2dec390fc99
2022-10-03T01:29:13.9647189Z [2022-10-03T01:29:13.963Z] ['info'] Uploading...
2022-10-03T01:29:14.2965433Z [2022-10-03T01:29:14.295Z] ['info'] ***"status":"success","resultURL":"https://app.codecov.io/github/VodafoneIS/sf-metadata/commit/8c35496b53791129326ba79c86a04d76419f0837"***
2022-10-03T01:29:14.3426264Z ##[group]Run actions/upload-artifact@v2
2022-10-03T01:29:14.3426685Z with:
2022-10-03T01:29:14.3427020Z   name: Distribution
2022-10-03T01:29:14.3427371Z   path: dist
2022-10-03T01:29:14.3427728Z   if-no-files-found: warn
2022-10-03T01:29:14.3428109Z ##[endgroup]

But when I open Codecov, it says "upload is empty"
image

This is how I configured Codecov's action

- name: Upload Code Coverage
        uses: codecov/codecov-action@v3
        if: ${{ matrix.environment == 'unprotected-prod' }}
        continue-on-error: true
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          flags: APEX
          directory: ./dist/${{ secrets.SF_ORG_ALIAS }}/tests/coverage/

This is the directory that I configured in codecov's actions
tests.zip

@AllanOricil
Copy link
Author

AllanOricil commented Oct 3, 2022

I tried with "cobertura" format and I got the same result

image

image

these are the files that were uploaded by the action

Archive.zip

@nerdyman
Copy link

nerdyman commented Oct 3, 2022

I'm also having this issue, looks like it finds the coverage files OK but there aren't any results on Codecov.

@samuelcolvin
Copy link
Contributor

@AllanOricil I'm having the same problem, I don't think your issue is that the upload is empty, but rather that codecov is (wrongly) deciding that CI is failing, see it says "X CI Failed" in the screenshot.

Because CI failed, they report "No Files covered..." rather than showing "CI failed".

At least that's my theory, I have been having the same problem.

@AllanOricil
Copy link
Author

@AllanOricil I'm having the same problem, I don't think your issue is that the upload is empty, but rather that codecov is (wrongly) deciding that CI is failing, see it says "X CI Failed" in the screenshot.

Because CI failed, they report "No Files covered..." rather than showing "CI failed".

At least that's my theory, I have been having the same problem.

Where did you see that the CI failed?

@samuelcolvin
Copy link
Contributor

in your screenshot, near the top.

@samuelcolvin
Copy link
Contributor

(screenshot from codecov)

@AllanOricil
Copy link
Author

@samuelcolvin found it.

image

It is really weird because it does not say what went wrong. Besides that, codecov's github action outputs success

image

@samuelcolvin
Copy link
Contributor

Yup, it's super confusing. I've had tests passing, but no visible coverage because codecov thinks the PR is failing. If I go back to the main page for the project and change branch, I can see coverage for the commit, but not a diff of coverage 😞.

I'm a bit confused by it all, but I think this is what codecov's CTO @hootener was saying to me on twitter.

@burgholzer
Copy link

We are also hitting this issue in cda-tum/mqt-qmap#138 (more generally in the whole project since approximately 3 weeks). All checks on GitHub pass and the codecov upload succeeds, but codecov won't post a report and reports "CI Failed" on the website.

In contrast to the above, we also see cases where codecov reports "CI Passed" and still shows that one of the uploads is empty.
image

@AllanOricil
Copy link
Author

@hootener are you tracking this issue somewhere else?

@woodruffw
Copy link

I'm seeing the same thing while trying to configure Codecov on a public repository: Codecov's website both says that the CI has failed (it hasn't) and that the upload is empty (it isn't).

@woodruffw
Copy link

This may or may not help others, but I seem to have gotten Codecov into a semi-working state by uploading coverage.py's XML report format instead of the default SQLite DB.

In particular, if I run python -m coverage xml and upload the coverage.xml that results, Codecov seems to ingest it.

@samuelcolvin
Copy link
Contributor

Sadly I get the problem when uploading an xml from coverage, so I'm afraid that's not a panacea, though if it's working, it's working 🤷.

@AllanOricil
Copy link
Author

AllanOricil commented Nov 2, 2022

A month has passed and this hasn't been fixed. Did any of you fix the problem somehow? or did Codecov's devs comment about this issue somewhere?

@woodruffw
Copy link

A month has passed and this hasn't been fixed. Did any of you fix the problem somehow? or did Codecov's devs comment about this issue somewhere?

Not for me. The "fix" I posted above has stopped working consistently for me.

brentyi added a commit to brentyi/tyro that referenced this issue Nov 2, 2022
@ppamorim
Copy link

ppamorim commented Nov 3, 2022

I have the same issue, I can't make my Xcode xcresult code coverage to show up.

Edit:

I replaced this action with this and now the code coverage is being correctly processed:

- name: 🔄 Upload code coverage to Codecov
  run: |
    npm i yargs --save
    node ./.github/scripts/generate-codecov-json.js --archive-path ./results.xcresult
    bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }} -f ./coverage-report-results.json

The example is located here: codecov/uploader#223 (comment)
The javascript file: https://github.com/codecov/xcode-poc/blob/master/generate-codecov-json.js
From this repo: https://github.com/codecov/xcode-poc

I assume this action is broken and should not be used.

@AllanOricil
Copy link
Author

I have the same issue, I can't make my Xcode xcresult code coverage to show up.

Edit:

I replaced this action with this and now the code coverage is being correctly processed:

- name: 🔄 Upload code coverage to Codecov
  run: |
    npm i yargs --save
    node ./.github/scripts/generate-codecov-json.js --archive-path ./results.xcresult
    bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }} -f ./coverage-report-results.json

The example is located here: codecov/uploader#223 (comment)
The javascript file: https://github.com/codecov/xcode-poc/blob/master/generate-codecov-json.js
From this repo: https://github.com/codecov/xcode-poc

I assume this action is broken and should not be used.

So you are just manually uploading your code coverage to codecov?

@ppamorim
Copy link

ppamorim commented Nov 7, 2022

@AllanOricil Correct

@AllanOricil
Copy link
Author

AllanOricil commented Nov 15, 2022

@ppamorim didnt work for me
image

How is the codecov.yml configured in your project?

@daneeq
Copy link

daneeq commented Nov 15, 2022

Same problem with Xcode. First I thought it might be because we had no coverage results on main branch, so I tried it locally with the uploader, but still the same result. But it explicitly mentioned the xcode conversion step

image

and created a json file, but it was empty:

image

In Xcode, the coverage shows up correctly

So maybe the upload itself works but the conversion doesn't?

I tried to convert manually using @ppamorim 's answer, and now the json is not empty, but the upload still shows nothing, albeit the message is different:

image

image

... maybe the nulls? 🤔

@AllanOricil
Copy link
Author

I'm really lost here 😐

@tmcg0
Copy link

tmcg0 commented Nov 16, 2022

Same problem over here.

codecov-action reporting successful ingestion:
image

But codecov.io dashboard reporting CI failed with the upload being empty:
image

My coverage build environment: ubuntu-latest, c++, gcc, cmake with a custom coverage hook, report generation via lcov, uploading to codecov via codecov-action v3.

@tmcg0
Copy link

tmcg0 commented Nov 16, 2022

I was intermittently seeing this issue pop up in the action debug logs, so I'm wondering if these two issues are related.

@AllanOricil
Copy link
Author

AllanOricil commented Nov 18, 2022

Codecov does not work at all. For unknow reason every upload I do, using any of my github actions, always shows as "Upload is empty". But when this github app uploads the "SAME" coverage, it works

image

why does it create this "merge" commit? I don't understand.

@md384
Copy link

md384 commented Nov 21, 2022

We are seeing similar problems with the circleCI orb so I don't think this is limited to the GH action. Codecov shows CI as passing for us too. Support suggested manual path fixing (https://docs.codecov.com/docs/fixing-paths) but we didn't have any luck with that - the flags that fail for us are consistent across runs but are no different to some that pass (and use common functionality to generate the report and upload it).

@alexgougou
Copy link

alexgougou commented Nov 29, 2022

We are having similar problems with circleCI.
Before we upload, we convert the xcresult to json format report, but after upload, the codecov say the upload is empty. Maybe the format of report is not supported
xcrun xccov view --report UnitTest.xcresult --json >> result.json
image
image

@connorivy
Copy link

+1 to this thread. I'm also experiencing this issue when trying to upload coverage reports generated by xunit and coverlet

@avylove
Copy link

avylove commented Dec 25, 2022

Getting the same message and I noticed codecov does not see the branch the commit is for. In my case the upload is for the main branch, but, in the branch pull-down menu, there is no main listed. Couldn't find a way to get codecov to resync the branches.

edit: I did a little experimenting and this doesn't seem to be related as I get the same issue on branches that are listed

@AllanOricil
Copy link
Author

Just give up on this. No support from the maintainers means you will only be wasting your time.
Their girhub bot also behaves weirdly. It computes code coverage even when there isn't any code coverage reports. Moreover it is able to upload reports without this "upload is empty" error 🤯

@marvelous-melanie
Copy link

I had this issue and solved it by adding the checkout action to my codecov job. I was running tests in other jobs and uploading the coverage files as artifacts for my uploader job, so the rest of the repo wasn't present. It's not really documented that the codecov uploader requires the full repo presence in order to successfully upload a report.

Don't think this will solve the full issue here but something to check before giving up!

@connorivy
Copy link

Tried for a while to get codecov to work, but I couldn't get past this issue. I ended up switching to use https://coveralls.io/. I was able to get it up and running pretty easily and it does everything that I was looking for from codecov (I pretty much just wanted the badge on my repo).

@Simply007
Copy link

Same issue here - here is my GH run:

https://github.com/kontent-ai/management-sdk-net/actions/runs/3855468419/jobs/6570551138

And on codecov I am getting: https://app.codecov.io/github/kontent-ai/management-sdk-net/commit/21cb5e00a89ce34c4b380eadeafcdaa4f65a8bdd

image

I have tried to pass the Auth token too (even though it is a public repository) with no luck.

Codecov is showing the CI failed, by my CI passed.
I have also found the response for ploads:

<Error>
<Code>ExpiredToken</Code>
<Message>The provided token has expired.</Message>
<Details>Request signature expired at: 2023-01-06T13:11:30+00:00</Details>
</Error>

@alexgougou
Copy link

alexgougou commented Jan 9, 2023

Finally, we change fastlane to build the app, and upload the slather report, it works.
Maybe you need not change to fastlane, only convert the report to slather format
here is my fastfile

  lane :unitTest do

	run_tests(
 		scheme: "XXXX",
	                 code_coverage: true,
		clean: true,
		device: "iPhone 11 Pro Max",
		workspace: "XXX.xcworkspace",
		output_directory: "reportOutput/",
		derived_data_path: "testOutput/")

slather(
	build_directory: "testOutput/",
	scheme: "XXXX",
	workspace: "XXX.xcworkspace",
	proj: "XXXX.xcodeproj",
	output_directory: "testOutput/slatherOutput", 
	cobertura_xml: true,
	ignore: ["Pods/*", "3rdparty/*"])
end

and you should upload the cobertua.xml report
image

The slather command
slather coverage --cobertura-xml --build-directory testOutput/ --output-directory testOutput/slatherOutput

@AllanOricil
Copy link
Author

AllanOricil commented Jan 9, 2023

I fixed my problem after setting disable_default_path_fixes to false. And since I did not let codecov's action fix paths to me, I had to create my own custom action to do so.

codecov.yml

codecov:
    disable_default_path_fixes: true

workflow.yml

...
 - name: Fix Apex Code Coverage
        uses: VodafoneIS/salesforce-fix-code-coverage-reports-action@main
        if: ${{ env.SF_REPORT_APEX_CODE_COVERAGE == 'true' && steps.codecov_user.outputs.is_active == 'true' }}
        continue-on-error: true
        with:
          code-coverage-report-path: ./dist/${{ secrets.SF_ORG_ALIAS }}/tests/coverage/coverage.json
          code-coverage-report-type: APEX
          output-directory: ./dist/${{ secrets.SF_ORG_ALIAS }}/tests/coverage

      - name: Upload Apex Code Coverage
        uses: codecov/codecov-action@v3
        if: ${{ env.SF_REPORT_APEX_CODE_COVERAGE == 'true' && steps.codecov_user.outputs.is_active == 'true' }}
        continue-on-error: true
        with:
          flags: APEX
          token: ${{ secrets.CODECOV_COVERAGE_UPLOAD_TOKEN }}
          files: ./dist/${{ secrets.SF_ORG_ALIAS }}/tests/coverage/fixed-coverage.json
...

@sylvchev
Copy link

sylvchev commented Jan 9, 2023

I had a similar issue for several months. I managed to solve this issue by changing the format of the upload to codecov to XML. coverage was generating a internal file and I had to add an export in XML, then upload the XML file to codecov.

@pmalek
Copy link

pmalek commented Feb 1, 2023

For me using Golang, it was a matter of adding -coverpkg <PACKAGE_DIR> so that I actually get the cover profile for packages I want 🤦 .

@dzikoysk
Copy link

dzikoysk commented Feb 3, 2023

For Gradle users: the issue is pretty much the same, just upload jacocoTestReport.xml files instead of test.exec from JaCoCo:

@thomasrockhu-codecov
Copy link
Contributor

Hi all, this topic has gotten a little out of hand for me to be able to process properly. Some of the issues that you are having are related, but it's not directly clear.

I'm going to close this out and point to the community boards as the place to get help if you still are running into an empty upload issue. It is far easier for me to handle types of issues there.

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