Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #388 +/- ##
==========================================
+ Coverage 65.46% 66.97% +1.51%
==========================================
Files 218 218
Lines 18120 18120
==========================================
+ Hits 11862 12136 +274
+ Misses 5164 4844 -320
- Partials 1094 1140 +46 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
mwbrooks
left a comment
There was a problem hiding this comment.
Comments the kind ones 🤾🏻
| // TODO: Refactor to use afero.Fs once ExtractAndWriteFile accepts it. Currently uses t.TempDir() which is safe. | ||
| func Test_ExtractAndWriteFile(t *testing.T) { |
There was a problem hiding this comment.
note: I've decided to implement these tests now using the t.TempDir() approach, but I've added a comment to refactor the code being tested to inject afero.Fs so that we can change the tests to be our memory-base FS.
| // TODO: Refactor to use afero.Fs once Copy accepts it. Currently uses t.TempDir() which is safe. | ||
| func Test_Copy(t *testing.T) { |
There was a problem hiding this comment.
note: More reminders to refactor this, but these tests are safe to run since they are in the temp directory (just slower).
|
|
||
| // TODO: Refactor to use afero.Fs once CopyDirectory accepts it. Currently uses t.TempDir() which is safe. | ||
| func Test_CopyDirectory(t *testing.T) { | ||
| t.Run("copies directory structure", func(t *testing.T) { |
There was a problem hiding this comment.
note: Not using Table Tests here because each test case needs unique setup. To find a balance, I'm using the t.Run("...") to still group the test cases together in the same spirit as table tests.
srtaalej
left a comment
There was a problem hiding this comment.
LGTM! thanks for increasing our coverage 🟢 🟢 🟢 🚀
Changelog
Summary
This pull request add unit test coverage for 10 previously untested files across internal packages:
internal/apiinternal/archiveutilinternal/cmdutilinternal/configinternal/goutilsinternal/imageinternal/iostreamsinternal/ioutilsinternal/promptsOnly test files were changed in this pull request.
Requirements