Skip to content
This repository has been archived by the owner on Aug 4, 2023. It is now read-only.

fix: ignore codecov.io reporting failure #148

Merged
merged 1 commit into from
Apr 5, 2021

Conversation

trentm
Copy link
Member

@trentm trentm commented Apr 5, 2021

Because of codecov/codecov-node#284 codecov
reporting is sometimes failing. With the new default node v15 option
of '--unhandled-rejections=strict', this results in the occasional
non-zero exit status, which breaks our node v15 builds. This changes to
ignore that exit status.

Because of codecov/codecov-node#284 codecov
reporting is sometimes failing. With the new default node v15 option
of '--unhandled-rejections=strict', this results in the occasional
non-zero exit status, which breaks our node v15 builds. This changes to
ignore that exit status.
@trentm trentm self-assigned this Apr 5, 2021
@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label Apr 5, 2021
@trentm
Copy link
Member Author

trentm commented Apr 5, 2021

Using NODE_OPTIONS wasn't an option because you get this with node v8.6:

% NODE_OPTIONS='--unhandled-rejections=warn' ./node_modules/.bin/codecov
node: --unhandled-rejections=warn is not allowed in NODE_OPTIONS

example with node v15 of the warning taking effect

% node --version
v15.5.0

% npm run coverage

> [email protected] coverage
> nyc report --reporter=text-lcov > coverage.lcov && (codecov || echo 'warning: ignoring codecov failure')

  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                                v3.8.1
==> Detecting CI Provider
    No CI Detected. Using git/mercurial
==> Configuration:
    Endpoint: https://codecov.io
{
  commit: '0dac0b1582f7b34130e06894ca383f1624578ef3',
  branch: 'trentm/blocking-behavior',
  package: 'node-v3.8.1'
}
==> Building file structure
==> Generating gcov reports (skip via --disable=gcov)
    $ find /Users/trentm/el/apm-nodejs-http-client2 -type f -name '*.gcno'  -exec gcov  {} +
    Failed to run gcov command.
==> Scanning for reports
    + /Users/trentm/el/apm-nodejs-http-client2/coverage.lcov
==> Uploading reports
/Users/trentm/el/apm-nodejs-http-client2/node_modules/teeny-request/build/src/agents.js:30
    var isHttp = uri.startsWith('http://');
                     ^

TypeError: Cannot read property 'startsWith' of undefined
    at Object.getAgent (/Users/trentm/el/apm-nodejs-http-client2/node_modules/teeny-request/build/src/agents.js:30:22)
    at requestToFetchOptions (/Users/trentm/el/apm-nodejs-http-client2/node_modules/teeny-request/build/src/index.js:86:30)
    at teenyRequest (/Users/trentm/el/apm-nodejs-http-client2/node_modules/teeny-request/build/src/index.js:143:14)
    at /Users/trentm/el/apm-nodejs-http-client2/node_modules/codecov/lib/codecov.js:213:9
    at /Users/trentm/el/apm-nodejs-http-client2/node_modules/teeny-request/build/src/index.js:233:13
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
warning: ignoring codecov failure

% echo $?
0

example with node 8.6

Showing this doesn't break usage with older node versions:

[9:31:13 trentm@pink:~/el/apm-nodejs-http-client2 (n:8.6 git:trentm/blocking-behavior)]
% npm run coverage

> [email protected] coverage /Users/trentm/el/apm-nodejs-http-client2
> nyc report --reporter=text-lcov > coverage.lcov && (codecov || echo 'warning: ignoring codecov failure')

  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                                v3.8.1
==> Detecting CI Provider
    No CI Detected. Using git/mercurial
==> Configuration:
    Endpoint: https://codecov.io
{ commit: '0dac0b1582f7b34130e06894ca383f1624578ef3',
  branch: 'trentm/blocking-behavior',
  package: 'node-v3.8.1' }
==> Building file structure
==> Generating gcov reports (skip via --disable=gcov)
    $ find /Users/trentm/el/apm-nodejs-http-client2 -type f -name '*.gcno'  -exec gcov  {} +
    Failed to run gcov command.
==> Scanning for reports
    + /Users/trentm/el/apm-nodejs-http-client2/coverage.lcov
==> Uploading reports
(node:53710) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'startsWith' of undefined
(node:53710) [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.

@trentm trentm requested a review from astorm April 5, 2021 16:44
@apmmachine
Copy link

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #148 opened

  • Start Time: 2021-04-05T16:43:09.660+0000

  • Duration: 6 min 11 sec

  • Commit: b36f8a5

Test stats 🧪

Test Results
Failed 0
Passed 14478
Skipped 0
Total 14478

Trends 🧪

Image of Build Times

Image of Tests

@trentm trentm merged commit 20f5fcd into master Apr 5, 2021
@trentm trentm deleted the trentm/ignore-codecov-failure branch April 5, 2021 18:16
@trentm trentm linked an issue Apr 5, 2021 that may be closed by this pull request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
agent-nodejs Make available for APM Agents project planning.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'npm run coverage' errors; breaks checks for node v15
3 participants