LCOV_EXCL_START not working in coverage reports

Please check the troubleshooting guide before creating a ticket.

Description

Code that is wrapped with LCOV_EXCL_START/LCOV_EXCL_STOP is being reported as red (not covered).

See spinel_command_to_cstr():

Repository

CI/CD

GitHub Actions

Uploader

Commit SHAs

eacbb9b8092530e4575747a3a1007d5962c0a5d6

Codecov YAML


coverage:
  status:
    project:
      default:
        target: auto
        threshold: 1%
        only_pulls: true
    patch: off

ignore:
  - "tests/*"
  - "third_party/**/*"

comment:
  layout: "diff, flags, files"
  after_n_builds: 16

Additional Information

This issue seems to have started recently (within past week).

Thanks @jwhui, I’ll take a look into why this is happening.

Hi @jwhui, this is a little difficult to debug. Would it be possible for you to use the name or flag field for the Action or the -n or -F arguments for the bash uploader to specify the GitHub Action workflow? You can use something like

-n ${GITHUB_WORKFLOW}

This will help isolate which action is causing the problem.

Thanks for looking into this.

I tried adding the name argument, but it doesn’t seem to work:

  1. https://github.com/jwhui/openthread/commit/1e0309755ba09dac3163dc98fc0bbea06edc4636
  2. https://github.com/jwhui/openthread/runs/1256214761?check_suite_focus=true
  3. https://codecov.io/gh/jwhui/openthread/commit/1e0309755ba09dac3163dc98fc0bbea06edc4636/build

Thoughts?

@jwhui, I think it might just be ${env.GITHUB_WORKFLOW}

That didn’t seem to work either:

  1. https://github.com/jwhui/openthread/commit/79d3f960eeb20a97331c943539ad31ef4cbc5223

  2. https://github.com/jwhui/openthread/runs/1256496876?check_suite_focus=true

  3. https://codecov.io/gh/jwhui/openthread/commit/79d3f960eeb20a97331c943539ad31ef4cbc5223/build

Thoughts?

Hmmm… ${GITHUB_WORKFLOW}? I don’t think you need env.

Was this resolved? It is not clear to me from post#7 what the solution to the post#1 was. I am new to codecov.io, so my apologies if I am missing something obvious!

This diff shows lines 13 and 14 uncovered even though they are in an LCOV_EXCL_START/LCOV_EXCL_STOP block as uncovered (I think). See red markers in the codecov.io screenshot below. By contrast, LCOV itself shows those lines as N/A (white).

Thanks in advance for any insight you can provide!

@cxw42, I’ll make a fix to our bash uploader that should address this.

Hi @cxw42, this should be fixed now. Let me know if that’s not the case.