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

Codecov is not uploading/commenting with coverage report #191

Closed
brandongregoryscott opened this issue May 3, 2021 · 5 comments · Fixed by #193 or #201
Closed

Codecov is not uploading/commenting with coverage report #191

brandongregoryscott opened this issue May 3, 2021 · 5 comments · Fixed by #193 or #201
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@brandongregoryscott
Copy link
Contributor

Looks like codecov has not been consistently uploading coverage reports since we ported over to Github Actions. Sifted through a couple of the recent PRs and I believe this is the only one that commented w/ the coverage report after the CI refactor: #167

Looks like others started reporting a similar error as of recently:

codecov/codecov-node#284

Output from a recent build:

  _____          _  
 / ____|        | |  
| |     ___   __| | ___  ___ _____   __  
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /  
| |___| (_) | (_| |  __/ (_| (_) \ V /  
 \_____\___/ \__,_|\___|\___\___/ \_/  
                                v3.8.1
==> Detecting CI Provider
    GitHub Actions CI Detected
==> Configuration: 
    Endpoint: https://codecov.io
{ commit: '7f36e100e64f67a96c9f38098bb894a8b77c33c9',
  branch: 'feature/list-commands-2',
  package: 'node-v3.8.1' }
==> Building file structure
==> Scanning for reports
    + D:\a\AndcultureCode.Cli\AndcultureCode.Cli\coverage\lcov.info
    + D:\a\AndcultureCode.Cli\AndcultureCode.Cli\coverage\clover.xml
==> Uploading reports
(node:1700) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'startsWith' of undefined
    at Object.getAgent (C:\npm\prefix\node_modules\codecov\node_modules\teeny-request\build\src\agents.js:30:22)
    at requestToFetchOptions (C:\npm\prefix\node_modules\codecov\node_modules\teeny-request\build\src\index.js:86:30)
    at teenyRequest (C:\npm\prefix\node_modules\codecov\node_modules\teeny-request\build\src\index.js:143:14)
    at C:\npm\prefix\node_modules\codecov\lib\codecov.js:213:9
    at C:\npm\prefix\node_modules\codecov\node_modules\teeny-request\build\src\index.js:233:13
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
(node:1700) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1700) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@brandongregoryscott brandongregoryscott added bug Something isn't working help wanted Extra attention is needed labels May 3, 2021
@cmd08
Copy link

cmd08 commented May 7, 2021

I had this issue - it's because the CODECOV_TOKEN was not in the GitHub Actions environment. The error message from codecov is not very helpful!

@brandongregoryscott
Copy link
Contributor Author

Interesting catch @cmd08, thanks. The messaging in my Codecov repo settings is a bit misleading, then:

The token below is used exclusively for uploading coverage reports.

Note: Token not required for public repositories uploading from Travis, CircleCI, AppVeyor, Azure Pipelines or GitHub Actions.

It looks like they built a custom action for uploading coverage, which might be an option too.

I'll try this out first and see if it resolves the issue - thank you!

@cmd08
Copy link

cmd08 commented May 7, 2021

I have confirmed following the instructions from the GitHub Actions docs here has resolved the issue. I just had my CODECOV_TOKEN listed as a secret, but I wasn't passing it into the environment.

@brandongregoryscott
Copy link
Contributor Author

Looks like that did the trick, thanks a bunch @cmd08

  _____          _  
 / ____|        | |  
| |     ___   __| | ___  ___ _____   __  
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /  
| |___| (_) | (_| |  __/ (_| (_) \ V /  
 \_____\___/ \__,_|\___|\___\___/ \_/  
                                v3.8.2
==> Detecting CI Provider
    GitHub Actions CI Detected
==> Configuration: 
    Endpoint: https://codecov.io
{ commit: '969d3dc0984ac6fd5e1b08060260b100cb500fc1',
  branch: 'main',
  package: 'node-v3.8.2' }
==> Building file structure
==> Scanning for reports
    + D:\a\AndcultureCode.Cli\AndcultureCode.Cli\coverage\lcov.info
    + D:\a\AndcultureCode.Cli\AndcultureCode.Cli\coverage\clover.xml
==> Uploading reports
    Success!
    View report at: https://codecov.io/github/AndcultureCode/AndcultureCode.Cli/commit/969d3dc0984ac6fd5e1b08060260b100cb500fc1

@brandongregoryscott
Copy link
Contributor Author

Spoke too soon. It seemed to work on a merge commit, but not this recent build: https://github.com/AndcultureCode/AndcultureCode.Cli/pull/196/checks?check_run_id=2538997923 or the build that ran after I updated this pull request https://github.com/AndcultureCode/AndcultureCode.Cli/pull/190/checks?check_run_id=2529650526

May need to look into using the official Codecov Github Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants