Results not uploaded to Codecov

Here’s my CircleCI config

version: 2.1
orbs:
  codecov: codecov/codecov@1.0.4
jobs:
  build:
    docker:
      - image: circleci/node:10.15.0
      - image: circleci/postgres:9.6.5-alpine-ram
    environment:
      DATABASE_URL: postgresql://root@localhost/circle_test
    steps:
      - checkout
      - restore_cache:
          keys:
            - npm-deps-{{ checksum "package-lock.json" }}
            - npm-deps-
      - run:
          name: Update NPM
          command: sudo npm i -g npm@latest
      - run:
          name: Install Dependencies
          command: npm i
      - save_cache:
          key: npm-deps-{{ checksum "package-lock.json" }}
          paths:
            - node_modules
      - run:
          name: Lint
          command: npm run lint
          when: always
      - run:
          name: Test
          command: npm run test
          when: always
      - codecov/upload:
          file: ./coverage/lcov.info
workflows:
  version: 2
  testing:
    jobs:
      - build

When it’s run, however, the step for uploading results isn’t shown in the build, and Codecov doesn’t recieve a report. My CODECOV_TOKEN environmental variable is set in my Circle options…

I don’t have a Codecov config, but the Codecov docs say it’s optional.

Hi Arthur,

It’s because the upload Orb step isn’t set to run on fail. You will want to add the when: always to that step as well.

1 Like

Oh dear. @thomasrockhu do you have any thoughts here?

(also moving into the Orbs category since that’s the root issue)

1 Like

Oh, I didn’t see that category.
(Also, even when test succeeds it doesn’t work.)

Oh, I didn’t see a success. Assuming I have the right project, can you let me know what build number for green you are looking at?

1 Like

cyclone-engine 14. Lint failed due to me forgetting to remove something which is why it’s red.

Ah, ok. Same issue. A step prior to the CodeCov steps (lint, in that case) failed, so that step didn’t run.

1 Like

Doesn’t not supplying when only base off of the previous step and not all of them?

I’d have to check the code, but I believe it checks against the status of the job, which would be marked failed at the first failed step.

1 Like

I’ll rerun then and see…

In case Tom doesn’t see this right away, can you also file an issue against the Orb repo here https://github.com/codecov/codecov-circleci-orb once you get it narrowed down?

1 Like

Yeah, sure

1 Like

Aha! You were right! It ran with a successful lint. We need a when key. I’ll post it.

Thanks for raising the issue! I’ll take a look at making the fix for this.

2 Likes

Thanks, @thomasrockhu.

I created https://github.com/codecov/codecov-circleci-orb/pull/15 which I think should fix this. :slight_smile:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.