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

Error: No files found matching glob pattern. #268

Open
reshad-equinix opened this issue Feb 28, 2024 · 15 comments
Open

Error: No files found matching glob pattern. #268

reshad-equinix opened this issue Feb 28, 2024 · 15 comments

Comments

@reshad-equinix
Copy link

I am attempting to use CodeCoverageSummary in a very similar way as in https://github.com/irongut/CodeCoverageSummary/blob/master/README.md (the .NET one except I am using Go). I am getting "no files found" even though the file is there. The symptom seems to be the same as what's reported @ https://stackoverflow.com/questions/73543621/coverage-xml-output-file-is-not-seen-in-github-actions-uses, is this an environment specific issue? Or is the example in the README not working as-is?

Run irongut/[email protected]
  with:
    filename: coverage.xml
    badge: false
    fail_below_min: false
    format: markdown
    hide_branch_rate: false
    hide_complexity: true
    indicators: true
    output: both
    thresholds: 60 80
<snip>

Error: No files found matching glob pattern.
@sgoldberg-polaris
Copy link

This issue started for me today as well when trying to update coverlet.collector from 6.0.0 to 6.0.1

Run irongut/CodeCoverageSummary@v1.[3]
with:
filename: coverage/*/coverage.cobertura.xml
badge: true
format: markdown
output: both
fail_below_min: false
hide_branch_rate: false
hide_complexity: false
indicators: true
thresholds: 50 75

Error: No files found matching glob pattern.

@super-jb
Copy link

super-jb commented May 31, 2024

Same output for me. Commenting here to follow along on any possible updates.

One thing I noticed, my generated cobertura.xml barely has anything in there.
I don't think it's an issue of finding the correct file, it's that the file doesn't have the necessary data.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
<coverage line-rate="1" branch-rate="1" lines-covered="0" lines-valid="0" branches-covered="0" branches-valid="0" complexity="NaN" version="0" timestamp="1717127627">
  <sources />
  <packages />
</coverage>

@sgoldberg-polaris @reshad-equinix, can you confirm on your end if you're experiencing the same?
@irongut, thoughts?


UPDATE: Error: No files found matching glob pattern.
Looks like this error message happens pretty early on. I know for sure the file I'm passing in exists. I'm stumped 🤷🏼

@reshad-equinix
Copy link
Author

Same output for me. Commenting here to follow along on any possible updates.

One thing I noticed, my generated cobertura.xml barely has anything in there. I don't think it's an issue of finding the correct file, it's that the file doesn't have the necessary data.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
<coverage line-rate="1" branch-rate="1" lines-covered="0" lines-valid="0" branches-covered="0" branches-valid="0" complexity="NaN" version="0" timestamp="1717127627">
  <sources />
  <packages />
</coverage>

@sgoldberg-polaris @reshad-equinix, can you confirm on your end if you're experiencing the same?

I never got it to work and I have given up on this.

@irongut, thoughts?

UPDATE: Error: No files found matching glob pattern. Looks like this error message happens pretty early on. I know for sure the file I'm passing in exists. I'm stumped 🤷🏼

I also know for sure the file I was passing does exist. I can buy the argument that it's missing something.

@VAllens
Copy link

VAllens commented Aug 19, 2024

Me too.
At first, I thought it was a path issue.
Later, after many tweaks and tests, I confirmed that the path is correct and the file exists.

@VAllens
Copy link

VAllens commented Aug 19, 2024

This issue started for me today as well when trying to update coverlet.collector from 6.0.0 to 6.0.1

Run irongut/CodeCoverageSummary@v1.[3]
with:
filename: coverage/*/coverage.cobertura.xml
badge: true
format: markdown
output: both
fail_below_min: false
hide_branch_rate: false
hide_complexity: false
indicators: true
thresholds: 50 75

Error: No files found matching glob pattern.

I rolled back the coverlet.* version from 6.0.2 to 6.0.0 and the problem remains.
It doesn't look like that's what's causing the problem.

@VAllens
Copy link

VAllens commented Aug 19, 2024

I suspect this is due to an external coverage.cobertura.xml file that is not mounted inside the CodeCoverageSummary container instance causing the Error: No files found matching glob pattern. !!!

As this user would say: “Apparently the solution was to create a bind mount from the container to the host, so the coverage reporter can access.”

@VAllens
Copy link

VAllens commented Aug 19, 2024

I amend the statement I made earlier.

When I use a glob path —— filename: ${{ github.workspace }}/coverage/**/coverage.cobertura.xml or filename: coverage/**/coverage.cobertura.xml or filename: coverage/*/coverage.cobertura.xml,
it outputs: Error: No files found matching glob pattern.

When I use an absolute path —— filename: ${{ github.workspace }}/coverage/coverage.cobertura.xml,
it outputs: Error: No files found matching glob pattern.

When I use relative path —— filename: coverage/coverage.cobertura.xml,
it works.

About the coverage/coverage.cobertura.xml file path:
The coverage/coverage.cobertura.xml file path is located in the ${{ github.workspace }}/coverage folder path.

After executing the dotnet test --nologo --no-restore --configuration Release --runtime linux-x64 --collect:"XPlat Code Coverage" --results-directory "${{ github.workspace }}/coverage" command,
the coverage.cobertura.xml file is generated under the ${{ github.workspace }}/coverage/648b9892-da05-42c2-90dc-a9f1d23077dd/ folder path.

I execute the cp ${{ github.workspace }}/coverage/**/coverage.cobertura.xml ${{ github.workspace }}/coverage/coverage.cobertura.xml command,
copy it to the ${{ github.workspace }}/coverage folder path.

So coverage.cobertura.xml file exists in both ${{ github.workspace }}/coverage/648b9892-da05-42c2-90dc-a9f1d23077dd/ and ${{ github.workspace }}/coverage paths.

@webknjaz
Copy link

When I use an absolute path —— filename: ${{ github.workspace }}/coverage/coverage.cobertura.xml, it outputs: Error: No files found matching glob pattern.

When I use relative path —— filename: coverage/coverage.cobertura.xml, it works.

I was just about to comment the same... It looks like because this is a docker-based container, the work dir might be mounted under a slightly different path so it's imperative to pass relative paths for this to work. It could be documented better, though.

@meza
Copy link

meza commented Oct 4, 2024

Anyone with a solution to this?
I have self-hosted runners in docker and am hitting a brick wall with this. Using relative **/coverage.xml paths :(

@super-jb
Copy link

super-jb commented Oct 4, 2024

@webknjaz, see the solution on this thread (worked for me):
SeanKilleen/ExampleTestResultsWithGithubActions#9

Hope it helps 🙏🏼

@meza
Copy link

meza commented Oct 4, 2024

Thanks! Not sure it's the same situation as mine works perfectly until I drop it into a self-hosted runner that's already within docker.

@evilfeeh
Copy link

evilfeeh commented Oct 4, 2024

I Solved it. In my case, it was a misspelling of the coverage filename.

@kotsaris
Copy link

As others have said, the fact that the github action runs as a docker container messes up the paths and the filename parameter isn't what you'd expect it to be (read: does not necessarily respect your current working directory and so on).

You want to treat the filename parameter as if you are at the root of your repository.

In my case, it means changing
filename: cobertura//coverage.cobertura.xml
to
filename: src/cobertura/
/coverage.cobertura.xml

of course, make sure you don't name your cobertura to a different filename.

Copy link

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 30 days.

@github-actions github-actions bot added stale and removed stale labels Jan 25, 2025
@VAllens
Copy link

VAllens commented Jan 26, 2025

Please reopen it.

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

8 participants