archived-codacy / node-codacy-coverage

Code Coverage reporter for Codacy
MIT License
63 stars 45 forks source link

Error while sending coverage using mocha #75

Closed vjoshihumancare closed 4 years ago

vjoshihumancare commented 5 years ago

Hi, I am trying to send coverage to codecy using mocha on windows machine which is my local machine. I am using following command istanbul cover ./node_modules/mocha/bin/_mocha ./test --report lcovonly -- -R spec && type ./coverage/lcov.info | codacy-coverage --token && rm -rf ./coverage

However I get following error message . Any idea what this means ?

name: 'ValidationError', details: [ { message: '"value" is not allowed to be empty', path: [], type: 'any.empty', context: [Object] } ], _object: '', annotate: [Function] } [error] "2018-12-27T00:50:29.650Z" 'Error sending coverage' [error] "2018-12-27T00:50:29.650Z" { ValidationError: "value" is not allowed to be empty at Object.exports.process (C:

rtfpessoa commented 5 years ago

@vjoshihumancare the message is pretty cryptic. Can you run the tool with --debug and provide the full output.

Also, from first look when you invoke ... | codacy-coverage --token <missing-token> && ... I am guessing you removed the token to post here but you placed it there when invoking.

finaxar-arthur commented 5 years ago

I used this command

"jest --passWithNoTests --coverage && cat ./coverage/lcov.info | codacy-coverage --language typescript --debug"

with CI and CODACY_PROJECT_TOKEN set as environment variables. I get the same error as the person above.

This is the output from --debug

Ran all test suites.
[info] "2019-06-24T10:10:20.432Z"  'Started with: token [undefined], accountToken [undefined], username [undefined], projectName [undefined], commitId [undefined], language [undefined], endpoint [undefined], format [undefined], path prefix [undefined], verbose [undefined], debug [true]'
[trace] "2019-06-24T10:10:20.439Z"  'Received file through stdin'
[info] "2019-06-24T10:10:20.439Z"  'Handling input for: token ["<redacted>"], accountToken [undefined], username [undefined], projectName [undefined], commitId [undefined], language [undefined], endpoint [undefined], format ["lcov"], path prefix [""], verbose [undefined], debug [true]'
[debug] "2019-06-24T10:10:20.442Z"  'Parsing Lcov Data'
[error] "2019-06-24T10:10:20.446Z"  { ValidationError: "value" is not allowed to be empty
ljmf00 commented 4 years ago

Hey @vjoshihumancare and @finaxar-arthur ,

Can you check if the stdin is send something to the reporter? It seems you are passing an empty buffer. Check the content of your coverage output file.

Thanks, Luis

mrfyda commented 4 years ago

Closed due to inactivity.