Skip to content

test: increase test coverage for pkg/version and slackdeps#409

Merged
mwbrooks merged 6 commits intomainfrom
mwbrooks-test-coverage-3
Mar 18, 2026
Merged

test: increase test coverage for pkg/version and slackdeps#409
mwbrooks merged 6 commits intomainfrom
mwbrooks-test-coverage-3

Conversation

@mwbrooks
Copy link
Member

@mwbrooks mwbrooks commented Mar 18, 2026

Changelog

  • N/A

Summary

This pull request increases our test coverage in internal/pkg/version and internal/slackdeps.

I skipped updating a few other internal/pkg since there are some active refactoring going on in those packages and I want to avoid overcomplicating that work.

Tests are ordered alphabetically, grouping getters/setters, and constructors are at the top.

Requirements

@mwbrooks mwbrooks added this to the Next Release milestone Mar 18, 2026
@mwbrooks mwbrooks self-assigned this Mar 18, 2026
@mwbrooks mwbrooks added code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment labels Mar 18, 2026
@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.28%. Comparing base (34ac465) to head (db2adf6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #409      +/-   ##
==========================================
+ Coverage   68.16%   68.28%   +0.11%     
==========================================
  Files         218      218              
  Lines       18058    18058              
==========================================
+ Hits        12310    12331      +21     
+ Misses       4594     4569      -25     
- Partials     1154     1158       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member Author

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

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

A little guidance for the readers

t.Run(name, func(t *testing.T) {
o := NewOs()
if tc.value != "" {
t.Setenv(tc.key, tc.value)
Copy link
Member Author

Choose a reason for hiding this comment

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

note: t.Setenv(...) is a built-in that backs up the original environment variable value, sets the new value, and then restores the original when the test completes. I'd rather use a 100% mocked call, but this is a good and safe start.

@mwbrooks mwbrooks marked this pull request as ready for review March 18, 2026 16:05
@mwbrooks mwbrooks requested a review from a team as a code owner March 18, 2026 16:05
Copy link
Member

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

@mwbrooks LGTM! 🎁 🧪 ✨

And thanks for keeping adjacent changes minded in updates here! I hope it doesn't stall testing efforts much but I do think it'll help us in those updates!

@mwbrooks
Copy link
Member Author

And thanks for keeping adjacent changes minded in updates here! I hope it doesn't stall testing efforts much but I do think it'll help us in those updates!

No stales at all! I'll keep little test coverage PRs coming and once the sensitive areas are ready, we can see if there's testing opportunities hidden! 🕵🏻

Thanks for the quick review! 🙇🏻

@mwbrooks mwbrooks merged commit 11917c5 into main Mar 18, 2026
8 checks passed
@mwbrooks mwbrooks deleted the mwbrooks-test-coverage-3 branch March 18, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants