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

Multiple coverage files - Wildcard only selects one file #163

Closed
JonWillis-Tote opened this issue Jun 25, 2023 · 3 comments
Closed

Multiple coverage files - Wildcard only selects one file #163

JonWillis-Tote opened this issue Jun 25, 2023 · 3 comments

Comments

@JonWillis-Tote
Copy link

JonWillis-Tote commented Jun 25, 2023

Hi,

I believe the uploader, including the Orb, supports both a CSV upload, as well as wildcards using the *.

I read the docs, and previous issues - #6 and #138
But I still cannot seem to get multiple uploads working.

I run the following command

dotnet test --filter "Unit" --test-adapter-path:. --logger:"junit;LogFileName=xunit/results.xml" --results-directory:test-results --collect:"XPlat Code Coverage"

This generates the following 2 files, one for each test assembly in the solution.

  /home/circleci/project/test-results/e59140de-d31f-48a3-801a-2d0224f9e84c/coverage.cobertura.xml
  /home/circleci/project/test-results/c0301c42-49e5-41cf-862c-45ea7a8b3a15/coverage.cobertura.xml

I've tried running codecov/upload with the file parameter set to

  • ./test-results/*/*
  • ./test-results/*/coverage.cobertura.xml
  • ./test-results/**/coverage.cobertura.xml
  • ./test-results/*/*
    steps:
      - codecov/upload:
          file: './test-results/*/coverage.cobertura.xml'

And in all cases, it only uploads one file.

Codecov report uploader 0.6.1
[2023-06-25T14:05:13.406Z] ['info'] => Project root located at: /home/circleci/project
[2023-06-25T14:05:13.407Z] ['info'] ->  Token found by arguments
[2023-06-25T14:05:13.415Z] ['info'] Searching for coverage files...
[2023-06-25T14:05:13.473Z] ['info'] => Found 1 possible coverage files:
  ./test-results/c0301c42-49e5-41cf-862c-45ea7a8b3a15/coverage.cobertura.xml
[2023-06-25T14:05:13.473Z] ['info'] Processing ./test-results/c0301c42-49e5-41cf-862c-45ea7a8b3a15/coverage.cobertura.xml...
[2023-06-25T14:05:13.476Z] ['info'] Detected CircleCI as the CI provider.

I even tried just using *, and it uploaded 1 file from the current directory within the container.

Have I misunderstood the wildcarding features of the uploader/orb ?

Edit -

  • If it makes any difference, our build is running based on image from cimg/base:2023.06
  • Tried using Orb codecov-circleci-orb-3.2.2 and codecov-circleci-orb-3.2.5
@JonWillis-Tote
Copy link
Author

As an update

 steps:
      - codecov/upload:
          file: '*'

The above, uploaded, just one file.

 steps:
      - codecov/upload:
          file: '*,./test-results/*/coverage.cobertura.xml'

This uploaded every file in the current directory.

@JonWillis-Tote
Copy link
Author

This looks to be user error after all. Just needed to remove the dot, from the front of the path.

 steps:
      - codecov/upload:
          file: '/test-results/*/coverage.cobertura.xml'

This command will upload all files, rather than just the first one.

@thomasrockhu-codecov
Copy link
Contributor

@JonWillis-Tote sorry for getting back to you so late here. Looks like the issue is resolved. If not, please feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants