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

Files changed coverage rate not shown #30

Open
maltegoetz opened this issue Aug 3, 2022 · 1 comment
Open

Files changed coverage rate not shown #30

maltegoetz opened this issue Aug 3, 2022 · 1 comment

Comments

@maltegoetz
Copy link

Unfortunately the files changed coverage rate is not shown in the posted comment, only "n/a" is printed instead.

I am using v1.5.0, but had this with previous versions as well. I thought this might be fixed with the branch coverage now being calculated but the issues still seems to exist.
When looking at the output, the coverage per file looks fine.

Looking at the source code, I think this might be related to filtering out the files which are untouched.

lines = lines.filter((line, index) => {
if (index <= 2) return true; // Include header
for (const changedFile of changedFiles) {
console.log(`${line} === ${changedFile}`);
if (line.startsWith(changedFile)) return true;
}
return false;
});
if (lines.length === 3) { // Only the header remains
return ' n/a';
}

Is it maybe that the line does not start with the filename because it has the full path to the repo prepended?

Any ideas or suggestions appreciated!

@mvolpato
Copy link

mvolpato commented May 8, 2023

I had the same problem, I solved by changing the lcov file to remove the full path, something like:
sed -i '' "s;$PWD/;;g" coverage/lcov.*.info

pavelsaman pushed a commit to pavelsaman/github-actions-report-lcov that referenced this issue Apr 9, 2024
Bumps [@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome) from 1.6.3 to 1.6.4.
- [Release notes](https://github.com/biomejs/biome/releases)
- [Changelog](https://github.com/biomejs/biome/blob/main/CHANGELOG.md)
- [Commits](https://github.com/biomejs/biome/commits/cli/v1.6.4/packages/@biomejs/biome)

---
updated-dependencies:
- dependency-name: "@biomejs/biome"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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