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

feat: add file-coverage-root-path option to customize coverage report paths #444

Merged
merged 4 commits into from
Nov 17, 2024

Conversation

davelosert
Copy link
Owner

@davelosert davelosert commented Nov 17, 2024

Change Summary

This pull request introduces a new option to specify the root path for the file coverage reports, allowing for better handling the scenario where the reports were generated in a different context (e.g. a Docker container) where the included absolute file-paths differ from the current workspace of the runner.

Fixes #428 .

New Feature: File Coverage Root Path

  • Added file-coverage-root-path option to action.yml to specify the root path of the files within the coverage reports.
  • Updated README.md to include the new file-coverage-root-path option in the documentation.
  • Modified src/index.ts to pass the fileCoverageRootPath option to the run function.
  • Updated src/inputs/options.ts to read the file-coverage-root-path input and include it in the Options type. [1] [2] [3]
  • Enhanced src/report/generateFileCoverageHtml.ts and its tests to utilize the workspacePath parameter for generating file coverage HTML. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18]

@davelosert davelosert requested a review from Copilot November 17, 2024 09:19
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 suggestion.

Files not reviewed (1)
  • src/index.ts: Evaluated as low risk

Tip: Leave feedback on Copilot's review comments with the 👎 and 👍 buttons to help improve review quality. Learn more

action.yml Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Nov 17, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 72.46%
⬇️ -0.09%
621 / 857
🔵 Statements 72.46%
⬇️ -0.09%
621 / 857
🔵 Functions 87.5%
🟰 ±0%
28 / 32
🔵 Branches 96%
🟰 ±0%
144 / 150
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/index.ts 0%
🟰 ±0%
0%
🟰 ±0%
0%
🟰 ±0%
0%
🟰 ±0%
1-167
src/inputs/options.ts 0%
🟰 ±0%
0%
🟰 ±0%
0%
🟰 ±0%
0%
🟰 ±0%
1-89
src/report/generateFileCoverageHtml.ts 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
Unchanged Files
src/icons.ts 100% 100% 100% 100%
src/octokit.ts 0% 0% 0% 0% 1-9
src/writeSummaryToComment.ts 100% 100% 100% 100%
src/writeSummaryToPR.ts 100% 100% 100% 100%
src/inputs/FileCoverageMode.ts 100% 100% 100% 100%
src/inputs/getCommentOn.ts 100% 100% 100% 100%
src/inputs/getCommitSHA.ts 100% 100% 100% 100%
src/inputs/getPullChanges.ts 100% 92.85% 100% 100%
src/inputs/getPullRequestNumber.ts 100% 100% 100% 100%
src/inputs/getViteConfigPath.ts 97.82% 87.5% 100% 97.82% 47
src/inputs/parseCoverageThresholds.ts 100% 100% 100% 100%
src/inputs/parseJsonReports.ts 0% 0% 0% 0% 1-52
src/report/generateCommitSHAUrl.ts 100% 100% 100% 100%
src/report/generateFileUrl.ts 100% 100% 100% 100%
src/report/generateHeadline.ts 100% 100% 100% 100%
src/report/generateSummaryTableHtml.ts 100% 100% 100% 100%
src/report/getCompareString.ts 100% 100% 100% 100%
src/report/getUncoveredLinesFromStatements.ts 100% 100% 100% 100%
Generated in workflow #779 for commit 72b06f6 by the Vitest Coverage Report Action

@davelosert davelosert requested a review from Copilot November 17, 2024 09:28

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 6 changed files in this pull request and generated no suggestions.

Files not reviewed (1)
  • src/index.ts: Evaluated as low risk

Tip: Turn on automatic Copilot reviews for this repository to get quick feedback on every pull request. Learn more

@davelosert davelosert merged commit 41d0c9e into main Nov 17, 2024
5 checks passed
@davelosert davelosert deleted the add-file-coverage-root-path-option branch November 17, 2024 09:31
daves-release-app bot pushed a commit that referenced this pull request Nov 17, 2024
# [2.8.0](v2.7.0...v2.8.0) (2024-11-17)

### Features

* Add file-coverage-root-path option to customize filer coverage report paths ([#444](#444)) ([41d0c9e](41d0c9e))
@daves-release-app
Copy link

🎉 This PR is included in version 2.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Configurable workspace path
1 participant