This repository was archived by the owner on Aug 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
This repository was archived by the owner on Aug 4, 2023. It is now read-only.
'npm run coverage' errors; breaks checks for node v15 #146
Copy link
Copy link
Closed
Labels
agent-nodejsMake available for APM Agents project planning.Make available for APM Agents project planning.
Description
Starting at least last Friday I'm seeing errors like the following from running code coverage: npm run coverage
With node v14 sometimes this:
% npm run coverage
> elastic-apm-http-client@9.6.0 coverage /Users/trentm/el/apm-nodejs-http-client2
> nyc report --reporter=text-lcov > coverage.lcov && codecov
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
v3.8.1
==> Detecting CI Provider
No CI Detected. Using git/mercurial
==> Configuration:
Endpoint: https://codecov.io
{
commit: 'c7cbce96795405dc91aebd92389ae69fe1f4f626',
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
Could not determine repo and owner
which is fine, I just don't have codecov.io creds setup.
With node v14 sometimes this:
% npm run coverage
> elastic-apm-http-client@9.6.0 coverage /Users/trentm/el/apm-nodejs-http-client2
> nyc report --reporter=text-lcov > coverage.lcov && codecov
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
v3.8.1
==> Detecting CI Provider
No CI Detected. Using git/mercurial
==> Configuration:
Endpoint: https://codecov.io
{
commit: 'c7cbce96795405dc91aebd92389ae69fe1f4f626',
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:34727) UnhandledPromiseRejectionWarning: 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:215:9
at /Users/trentm/el/apm-nodejs-http-client2/node_modules/teeny-request/build/src/index.js:233:13
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:34727) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:34727) [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.
which is concerning, but doesn't break builds because the exit status is still 0.
However, on node v15 is does exit non-zero:
% npm run coverage
> elastic-apm-http-client@9.6.0 coverage
> nyc report --reporter=text-lcov > coverage.lcov && codecov
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
v3.8.1
==> Detecting CI Provider
No CI Detected. Using git/mercurial
==> Configuration:
Endpoint: https://codecov.io
{
commit: 'c7cbce96795405dc91aebd92389ae69fe1f4f626',
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:215: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)
npm ERR! code 1
npm ERR! path /Users/trentm/el/apm-nodejs-http-client2
npm ERR! command failed
npm ERR! command sh -c nyc report --reporter=text-lcov > coverage.lcov && codecov
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/trentm/.npm/_logs/2021-03-29T17_15_05_970Z-debug.log
Presumably because in node v15 the new default is to throw on unhandled rejections (--unhandled-rejections=throw
).
This is codecov/codecov-node#284
markcellus
Metadata
Metadata
Assignees
Labels
agent-nodejsMake available for APM Agents project planning.Make available for APM Agents project planning.