Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codecov in action-ros-ci does not work #562

Closed
JaehyunShim opened this issue Mar 5, 2021 · 3 comments · Fixed by #568
Closed

Codecov in action-ros-ci does not work #562

JaehyunShim opened this issue Mar 5, 2021 · 3 comments · Fixed by #568
Labels
bug Something isn't working

Comments

@JaehyunShim
Copy link

Hi @christophebedard,

I would like to ask one more question about the action-ros-ci usage.

Description

Codecov result does not get uploaded.

Actual Behavior

To Reproduce

  1. I followed the instruction written in this link
  1. Get the following error code(?)
    https://github.com/JaehyunShim/test/runs/2038241504?check_suite_focus=true#step:4:31

  2. No result uploaded to Codecov.io
    https://app.codecov.io/gh/JaehyunShim/test

I tried

  1. add a commit to the 'master' branch directly
  2. make a new branch 'test' and pull request' to 'master' branch

but neither of them worked.

Thank you in advance,
Jaehyun

@JaehyunShim JaehyunShim added the bug Something isn't working label Mar 5, 2021
@christophebedard
Copy link
Member

christophebedard commented Mar 5, 2021

That looks like more of a codecov problem than an action-ros-ci problem since the coverage file is found here: https://github.com/JaehyunShim/test/runs/2038241504?check_suite_focus=true#step:4:35

One thing to note is this at the end of https://github.com/ros-tooling/action-ros-ci#integrate-action-ros-ci-with-codecov

You will also need to add a codecov.yaml configuration file (at the root of your repo):

fixes:
  - "ros_ws/src/my_package/::"

You put this: https://github.com/JaehyunShim/test/blob/de6193e61cff3c135a17e4850da2b6368ce23045/codecov.yml

fixes:
  - "ros_ws/src/test/::"

test isn't the name of your package. However, I don't think these instructions are valid, because your packages are actually under ros_ws/src/961tvszsfyl/test/ (where 961tvszsfyl is a random string and test is the name of your repo). Maybe this would work better:

fixes:
  - "ros_ws/src/*/test/topic_tutorial_cpp::"
  - "ros_ws/src/*/test/service_tutorial_cpp::"
  - "ros_ws/src/*/test/action_tutorial_cpp::"
  - "ros_ws/src/*/test/parameter_tutorial_cpp::"

I'll have to look into this a bit more and see if the README needs to be updated. The change that makes action-ros-ci use a random string + the name of the repo might've been made after these instructions were written.

In any case, it looks like codecov just isn't successful in uploading results.

@christophebedard
Copy link
Member

christophebedard commented Mar 6, 2021

@JaehyunShim I think I found the issue. Well, issues plural 😆.

See the updated/fixed documentation in #568, here: https://github.com/christophebedard/action-ros-ci/tree/e035c61e3c6433becfcef05f4b6ede0d785603a2#integrate-action-ros-ci-with-codecov

Your CI config should then look like this:

    # ...
    steps:
    - uses: actions/checkout@v2
    - uses: ros-tooling/setup-ros@v0.1
        with:
          required-ros-distributions: foxy
    - uses: ros-tooling/action-ros-ci@v0.1
      with:
        target-ros2-distro: foxy
        # build all packages listed in the meta package
        package-name:
          topic_tutorial_cpp
          service_tutorial_cpp
          action_tutorial_cpp
          parameter_tutorial_cpp
        vcs-repo-file-url: ""
        colcon-mixin-name: coverage-gcc
        colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
    - uses: codecov/codecov-action@v1
      with:
        file: ros_ws/lcov/total_coverage.info
        flags: unittests
        name: codecov-umbrella
    # ...

And you'll need a codecov.yml file that looks like this:

fixes:
  - "ros_ws/src/*/test/topic_tutorial_cpp::"
  - "ros_ws/src/*/test/service_tutorial_cpp::"
  - "ros_ws/src/*/test/action_tutorial_cpp::"
  - "ros_ws/src/*/test/parameter_tutorial_cpp::"

@JaehyunShim
Copy link
Author

@christophebedard
Thank you for your answer. It fixed the problem. I will close this thread.

emersonknapp pushed a commit that referenced this issue Mar 10, 2021
This makes various small changes to the README:

* fix codecov example/snippet
    * fixes #562
    * codecov.yaml seems to have been renamed to codecov.yml
    * actions/checkout is needed for codecov/codecov-action to get codecov.yml
    * update/fix codecov.yml example
    * mention needing to provide CODECOV_TOKEN only for private repos
    * update codecov/codecov-action version
    * use 'coverage-pytest' mixin in snippet too
* add table of contents for an easy overview of the README
* split ament_copyright basic example into binary vs source build
    * this makes it obvious to users that there are 2 ways of using the action
    * use a generic package name instead of ament_copyright
* uniformize snippets
    * remove use of actions/checkout when not needed
    * add `steps:` where needed so that snippets are complete-ish examples
* fix use of `if: always()` in logs upload example
* update commit used for colcon-mixin-repository
* add codecov badge
* make small fixes & rephrase & uniformize
* move 'Developing' section to the bottom
    * since this does not really apply to most people looking at the README

Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants