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: Adds name option #233

Merged
merged 4 commits into from
Jun 17, 2023
Merged

feat: Adds name option #233

merged 4 commits into from
Jun 17, 2023

Conversation

davelosert
Copy link
Owner

This adds an option name which can be used to parse and report several coverage-reports within the same workflow / within the same PR (previously, the comment would've been overwritten with the latest report).

Fixes #231

@aprehatny
Copy link

wow nice this is great! Thanks for doing this. Quick question i have regarding thresholds, would setting coverage thresholds in vitest still make the status function correctly for each report?

@github-actions
Copy link
Contributor

Coverage Report for ./test/mockReports

Status Category Percentage Covered / Total
🔵 Lines 41.37% 60 / 145
🔵 Statements 41.33% 62 / 150
🔵 Functions 62.06% 18 / 29
🔵 Branches 39.65% 23 / 58
File CoverageNo changed files found.

@github-actions
Copy link
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 58.28% 387 / 664
🔵 Statements 58.28% 387 / 664
🔵 Functions 73.68% 14 / 19
🔵 Branches 91.3% 63 / 69
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/generateHeadline.ts 100% 100% 100% 100%
src/index.ts 0% 0% 0% 0% 1-71
src/options.ts 0% 0% 0% 0% 1-34
src/writeSummaryToPR.ts 0% 0% 0% 0% 1-63
Unchanged Files
src/FileCoverageMode.ts 100% 100% 100% 100%
src/generateFileCoverageHtml.ts 100% 100% 100% 100%
src/generateFileUrl.ts 94.44% 50% 100% 94.44% 6
src/generateSummaryTableHtml.ts 100% 100% 100% 100%
src/getPullChanges.ts 0% 0% 0% 0% 1-58
src/getUncoveredLinesFromStatements.ts 100% 100% 100% 100%
src/getViteConfigPath.ts 100% 100% 100% 100%
src/icons.ts 100% 100% 100% 100%
src/parseCoverageThresholds.ts 100% 100% 100% 100%
src/parseJsonReports.ts 0% 0% 0% 0% 1-50

Repository owner deleted a comment from github-actions bot Jun 16, 2023
@davelosert
Copy link
Owner Author

@aprehatny : Sure, you're welcome. I'll probably merge this in tomorrow or Monday and do a new release then (so v2.1.0).

Regarding your question: If you specify the thresholds in the vitest-config, it should work out of the box.

If you have to distinct vitest-configs for each of your test-suites (so ts and tsx), then you'll have to provide the vite-config-path-option to the individual step and it will get parsed correctly.

@github-actions
Copy link
Contributor

Coverage Report for Mock Reports (./test/mockReports)

Status Category Percentage Covered / Total
🔵 Lines 41.37% 60 / 145
🔵 Statements 41.33% 62 / 150
🔵 Functions 62.06% 18 / 29
🔵 Branches 39.65% 23 / 58
File CoverageNo changed files found.

@github-actions
Copy link
Contributor

Coverage Report for Root

Status Category Percentage Covered / Total
🔵 Lines 58.28% 387 / 664
🔵 Statements 58.28% 387 / 664
🔵 Functions 73.68% 14 / 19
🔵 Branches 91.3% 63 / 69
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/generateHeadline.ts 100% 100% 100% 100%
src/index.ts 0% 0% 0% 0% 1-71
src/options.ts 0% 0% 0% 0% 1-34
src/writeSummaryToPR.ts 0% 0% 0% 0% 1-63
Unchanged Files
src/FileCoverageMode.ts 100% 100% 100% 100%
src/generateFileCoverageHtml.ts 100% 100% 100% 100%
src/generateFileUrl.ts 94.44% 50% 100% 94.44% 6
src/generateSummaryTableHtml.ts 100% 100% 100% 100%
src/getPullChanges.ts 0% 0% 0% 0% 1-58
src/getUncoveredLinesFromStatements.ts 100% 100% 100% 100%
src/getViteConfigPath.ts 100% 100% 100% 100%
src/icons.ts 100% 100% 100% 100%
src/parseCoverageThresholds.ts 100% 100% 100% 100%
src/parseJsonReports.ts 0% 0% 0% 0% 1-50

@davelosert davelosert merged commit 3e87b4c into main Jun 17, 2023
3 checks passed
@davelosert davelosert deleted the add-name-option branch June 17, 2023 10:45
github-actions bot pushed a commit that referenced this pull request Jun 17, 2023
# [2.1.0](v2.0.0...v2.1.0) (2023-06-17)

### Features

* Adds a link to the workflow run in the report ([#235](#235)) ([78069b4](78069b4))
* Adds name option ([#233](#233)) ([3e87b4c](3e87b4c))
@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.1.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.

Adding multiple coverage reports to a single workflow
2 participants