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

ci: enforce vitest coverage thresholds #2970

Merged

Conversation

wescopeland
Copy link
Member

At the moment, the React UI sits at 100% statement, branch, function, and line coverage. With over 1,100 unique test cases, there are a lot of examples to look to. As the UI continues to scale, we should probably shoot to keep the coverage level absurdly high.

This PR sets coverage thresholds to:

  • Lines - 98.5%
  • Functions - 100%
  • Branches - 98.5%
  • Statements - 98.5%

Personally, I plan on keeping everything at 100% coverage for all commits going forward.

@wescopeland wescopeland requested a review from a team December 22, 2024 21:32
@wescopeland wescopeland changed the title test: enforce vitest coverage thresholds ci: enforce vitest coverage thresholds Dec 22, 2024
Copy link
Member

@Jamiras Jamiras left a comment

Choose a reason for hiding this comment

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

I think this is a lofty goal that may impede new contributors, but if we can manage to maintain it, that would be great.

@wescopeland wescopeland merged commit 132c31a into RetroAchievements:master Dec 30, 2024
8 checks passed
@wescopeland wescopeland deleted the vitest-coverage-thresholds branch December 30, 2024 05:05
@wescopeland
Copy link
Member Author

may impede new contributors

I considered this as well. Over time it may be appropriate to lower the threshold, but given how much React code is in RAWeb now, 98.5% is probably appropriate for the time being.

When we approve code, we're not only saying "yes, this is fine to ship", but we're accepting responsibility for maintaining it over the long term, even if the new contributor disappears.

After doing a bunch of these site releases, I must confess I'm not happy to maintain untested code anymore. I feel way more at ease when whatever we're deploying has a high level of coverage. At least then when there's something to hotfix, I know the odds of causing a regression are fairly low.

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

Successfully merging this pull request may close these issues.

2 participants