Codecov orb and circleci

Hi there,

I’m struggling to get the circleci codecov orb to work with my nodejs project.

My circleci config file is at fuzzymatchingjs/config.yml at develop · seanoshea/fuzzymatchingjs · GitHub is where I’m trying to upload the code coverage information. I’m not sure whether this should be targeting coverage-final.json though & can’t seem to find docs on it?

Codecov has all the details on me somewhat flailing around trying to figure this out. At this point, I’m unsure of whether this failure is being caused by invalid paths or targeting the incorrect file in my configuration, so I’m somewhat at a loss here.

Hope someone can point me in the right direction.

Sean

Hi @seanoshea,

I apologize that this has been frustrating for you. This is due to rate limiting on the API token we use to pull the source files from GitHub.

We have requested an increase, sorry for the inconvenience. I’ll keep this thread open until it’s been resolved from GitHub.

Best,
Tom

Hi @seanoshea, we have narrowed down our issue a bit more, and we recommend using the Codecov app (Codecov | Code Coverage · GitHub Marketplace · GitHub) which should resolve your issue. Let me know if that works for you.

Hi there Tom,

Thanks for the pointer here - I tried adding this add to my github account and I believe it was set up correctly. I tried triggering a new build with https://github.com/seanoshea/fuzzymatchingjs/commit/c28e679d4b7705c8de80799cf267caeff5470c5e, but I’m still not seeing coverage reports still? https://app.circleci.com/pipelines/github/seanoshea/fuzzymatchingjs/34/workflows/92403fe9-a077-45b2-b85b-81a19bc15536/jobs/34 and https://codecov.io/gh/seanoshea/fuzzymatchingjs/commit/c28e679d4b7705c8de80799cf267caeff5470c5e are the additional links which might help pinpoint the root cause?

Any help is greatly appreciated,

Sean

Hi @seanoshea, looks like there might be an issue with how you are collecting coverage. This is the raw report, and I’m only seeing coverage for this file

/home/circleci/project/dist/fuzzymatchingjs.cjs.js

https://codecov.io/codecov/v4/raw/2020-05-17/A1360811B50F3EDD36D97ECF613FC22D/c28e679d4b7705c8de80799cf267caeff5470c5e/b8baf936-8c58-4e1e-bf10-cd93e6c122e0.txt

I would check how you are collecting coverage, out of curiousity what are you using to do this?

Hey Tom - yes, that’s the only file I’m using in the unit tests. Perhaps I should exclude a few more files from the code coverage report, but I’m not seeing anything at https://codecov.io/gh/seanoshea/fuzzymatchingjs/commit/c28e679d4b7705c8de80799cf267caeff5470c5e at all?

Apologies @seanoshea would you be able to push a newer commit on top? We don’t keep logs for that long. I’m guessing you might need to do path fixing.

Sure thing.

Pushed up https://github.com/seanoshea/fuzzymatchingjs/commit/630e03c1017354be2e2e97fea90da6b66062514a which resulted in https://app.circleci.com/pipelines/github/seanoshea/fuzzymatchingjs/35/workflows/e81be7a2-d66a-40a3-a52b-61328ff4d8b9/jobs/35/steps and https://codecov.io/gh/seanoshea/fuzzymatchingjs/commit/630e03c1017354be2e2e97fea90da6b66062514a

Sean

Hi @seanoshea, I think this is a path fixing issue. However, the thing that worries me is that the coverage report is coming from a dist folder, and I’m assuming you want coverage on src. I just want to double-check that you are running coverage on src files and not post-compiled ones.

If you don’t think that’s an issue, you can try adding

fixes:
  - "/home/circleci/project/dist/::src/lib/"

to your codecov.yml

I can’t guarantee that Codecov will be able to understand that the file fuzzymatchingjs.cjs.js is actually fuzzingmatching.js, however. And I believe it won’t be able to properly handle the wrong filename here. I’m actually fairly certain this will not work and you’ll need to run coverage against your src files.

Thank you for your patience as you guided me through this. You mentioning that I was targeting the dist folder instead of the src folder prompted me to make some changes. https://github.com/seanoshea/fuzzymatchingjs/pull/13 is the result. I think the code coverage reports are coming through fine now.

Thanks again,

Sean

1 Like

Amazing! Glad to see that it worked out for you.