test: increase test coverage for pkg/version and slackdeps#409
test: increase test coverage for pkg/version and slackdeps#409
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
mwbrooks
left a comment
There was a problem hiding this comment.
A little guidance for the readers
| t.Run(name, func(t *testing.T) { | ||
| o := NewOs() | ||
| if tc.value != "" { | ||
| t.Setenv(tc.key, tc.value) |
There was a problem hiding this comment.
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.
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! 🙇🏻 |
Changelog
Summary
This pull request increases our test coverage in
internal/pkg/versionandinternal/slackdeps.I skipped updating a few other
internal/pkgsince 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