Uploading D lang coverage doesn't work

Description

Uploading D lang coverage via bash uploader doesn’t work

CI/CD

Bitbucket pipelines

Uploader

bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN

Codecov Output

_____ _

/ ____| | |

| | ___ __| | ___ ___ _____ __

| | / _ \ / _ |/ _ / __/ _ \ \ / /`

| |___| (_) | (_| | __/ (_| (_) \ V /

\_____\___/ \__,_|\___|\___\___/ \_/

Bash-20200629-ffaf297

``

``

==> Bitbucket detected.

project root: .

Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml

==> Running gcov in . (disable via -X gcov)

==> Python coveragepy not found

==> Searching for coverage reports in:

+ .

--> No coverage report found.

Please visit http://docs.codecov.io/docs/supported-languages

``

``

Steps to Reproduce

  1. Run dub test -b unittest-cov
  2. Run bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN

Expected behavior:

All lst files are recogized and coverage is uploaded.

Actual behavior:

Even though .lst files are created in . directory they aren’t picked by uploader.

Flakiness? All the time

Hi @Mitacha, looks like you don’t have an accessible coverage file being uploaded. Can you try using the -f parameter to specify the filepath?

I tried adding -f, but it didn’t help, then I created ‘coverage’ directory and moved all .lst coverage files. After running uploader with -s covarage/*.lst I got:

==> Searching for coverage reports in:
    All my coverage files :)
    ...
--> No coverage report found.
    Please visit http://docs.codecov.io/docs/supported-languages

All files are found correctly, but nothing is uploaded

Interesting @Mitacha, would you be able to produce the entire Codecov output? Also, I noticed in the original post that you are using an older version of the bash script. Could this be cached somehow?

I ran dub run -b unittest-cov -- --DRT-covopt="dstpath:coverage" to output .lst files to coverage directory and then bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN -s 'coverage/*.lst

This is full output from my local machine:

  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                              Bash-20200707-353aa93


x> No CI provider detected.
    Testing inside Docker? http://docs.codecov.io/docs/testing-with-docker
    Testing with Tox? https://docs.codecov.io/docs/python#section-testing-with-tox
    project root: .
    Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
    + coverage/source-app.lst
    + coverage/source-ast-creators.lst
    + coverage/source-ast-expression.lst
    + coverage/source-ast-functions-declarations.lst
    + coverage/source-ast-functions-package.lst
    + coverage/source-ast-functions-registry.lst
    + coverage/source-ast-functions-validation.lst
    + coverage/source-ast-node.lst
    + coverage/source-ast-package.lst
    + coverage/source-ast-statement.lst
    + coverage/source-ast-testing-mock.lst
    + coverage/source-ast-testing-values.lst
    + coverage/source-visitor-eval.lst
    + coverage/source-visitor-package.lst
    + coverage/source-visitor-print.lst
    + coverage/source-visitor-typing.lst
    + coverage/source-visitor-validation.lst
--> No coverage report found.
    Please visit http://docs.codecov.io/docs/supported-languages

This is full output from bitbucket:

+ bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN -s 'coverage/*.lst'
  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                              Bash-20200707-353aa93
==> Bitbucket detected.
    project root: .
    Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
    + coverage/-home-circleci-.dub-packages-bolts-0.11.1-bolts-source-bolts-package.lst
    + coverage/-home-circleci-.dub-packages-optional-0.12.0-optional-source-optional-optional.lst
    + coverage/-home-circleci-.dub-packages-optional-0.12.0-optional-source-optional-package.lst
    + coverage/-home-circleci-.dub-packages-sumtype-0.8.13-sumtype-src-sumtype.lst
    + coverage/source-app.lst
    + coverage/source-ast-creators.lst
    + coverage/source-ast-expression.lst
    + coverage/source-ast-functions-declarations.lst
    + coverage/source-ast-functions-package.lst
    + coverage/source-ast-functions-registry.lst
    + coverage/source-ast-functions-validation.lst
    + coverage/source-ast-node.lst
    + coverage/source-ast-package.lst
    + coverage/source-ast-statement.lst
    + coverage/source-ast-testing-mock.lst
    + coverage/source-ast-testing-values.lst
    + coverage/source-visitor-eval.lst
    + coverage/source-visitor-package.lst
    + coverage/source-visitor-print.lst
    + coverage/source-visitor-typing.lst
    + coverage/source-visitor-validation.lst
--> No coverage report found.
    Please visit http://docs.codecov.io/docs/supported-languages

Hi @Mitacha, thanks for your patience here. It looks like we explicitly exclude *.lst files. Would it be possible to rename them to *.txt or similar?

Would it be possible to rename them to *.txt or similar?
Well, yes and no :slight_smile: . I ran renaming before using uploader:

dub run -b unittest-cov -- --DRT-covopt="dstpath:coverage"

for f in coverage/*.lst; do mv -- "$f" "${f%.lst}.txt"; done

bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN -s 'coverage/*.txt'

+ bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN -s 'coverage/*.txt'
  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                              Bash-20200707-353aa93
==> Bitbucket detected.
    project root: .
    Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
    + coverage/-home-circleci-.dub-packages-bolts-0.11.1-bolts-source-bolts-package.txt
    + coverage/-home-circleci-.dub-packages-optional-0.12.0-optional-source-optional-optional.txt
    + coverage/-home-circleci-.dub-packages-optional-0.12.0-optional-source-optional-package.txt
    + coverage/-home-circleci-.dub-packages-sumtype-0.8.13-sumtype-src-sumtype.txt
    + coverage/source-app.txt
    + coverage/source-ast-creators.txt
    + coverage/source-ast-expression.txt
    + coverage/source-ast-functions-declarations.txt
    + coverage/source-ast-functions-package.txt
    + coverage/source-ast-functions-registry.txt
    + coverage/source-ast-functions-validation.txt
    + coverage/source-ast-node.txt
    + coverage/source-ast-package.txt
    + coverage/source-ast-statement.txt
    + coverage/source-ast-testing-mock.txt
    + coverage/source-ast-testing-values.txt
    + coverage/source-visitor-eval.txt
    + coverage/source-visitor-package.txt
    + coverage/source-visitor-print.txt
    + coverage/source-visitor-typing.txt
    + coverage/source-visitor-validation.txt
--> No coverage report found.
    Please visit http://docs.codecov.io/docs/supported-languages

Looks like renaming didn’t help. I’m surprised that *.lst files are excluded, taking into account that they are produced by all D compilers during code coverage analysis. I think even if it helped, renaming should be consider temporary workaround, because D is listed as supported language and official example doesn’t say anything about renaming (GitHub - codecov/example-d: Example repository for D and Codecov).

@Mitacha, the PR is here. I’ll update here when it’s been merged and when it’s been deployed.

@Mitacha, the PR has been merged

@tom Thank you so much for your support. I look forward to try your changes :slight_smile:

Hi @Mitacha, the PR has been deployed. Let me know if you run into any other issues.

@tom I checked and everything works fine! Thank you very much for your support :slight_smile: