-
Notifications
You must be signed in to change notification settings - Fork 594
refactor(general): small misc. cleanups #4666
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4666 +/- ##
==========================================
+ Coverage 75.86% 76.41% +0.55%
==========================================
Files 470 529 +59
Lines 37301 40157 +2856
==========================================
+ Hits 28299 30687 +2388
- Misses 7071 7455 +384
- Partials 1931 2015 +84 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR performs miscellaneous cleanups across tests and code, focusing on refactoring OS checks, modernizing utility calls, and tightening test assertions and cache APIs.
- Replace literal
"windows"checks withwindowsOSNameconstant. - Simplify
slices.Compactusage and unify public/private cache methods. - Enhance and DRY up tests with
requirehelpers and newverifyCached/verifyNotCachedfunctions.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/end_to_end_test/snapshot_create_test.go | Swapped runtime.GOOS literal for windowsOSName. |
| tests/end_to_end_test/snapshot_actions_test.go | Same windowsOSName replacement in action script tests. |
| snapshot/policy/scheduling_policy.go | Removed redundant type args from slices.Compact. |
| internal/stat/stat_unix.go | Merged the package doc comments into one line. |
| internal/stat/stat_test.go | Renamed variables, tightened assertions, removed unused import. |
| internal/cache/persistent_lru_cache.go | Changed GetFull/GetPartial to private, updated internal calls. |
| internal/cache/export_test.go | Added TestingGetFull to expose private cache fetch for tests. |
| internal/cache/content_cache.go | Switched calls from GetFull/GetPartial to private versions. |
| internal/cache/persistent_lru_cache_test.go | Refactored tests to use verifyCached and verifyNotCached. |
Comments suppressed due to low confidence (4)
internal/cache/persistent_lru_cache.go:93
- Removing the exported
GetFullmethod breaks the public API. Consider retaining a public wrapper or marking it deprecated to avoid breaking external consumers.
// getFull fetches the contents of a full blob. Returns false if not found.
tests/end_to_end_test/snapshot_create_test.go:780
- Ensure that
windowsOSNameis defined and imported in this test; otherwise the reference will cause a compile error.
if runtime.GOOS == windowsOSName {
tests/end_to_end_test/snapshot_actions_test.go:268
- Ensure that
windowsOSNameis defined and imported in this test; otherwise the reference will cause a compile error.
if runtime.GOOS == windowsOSName {
internal/stat/stat_test.go:29
- [nitpick] The magic number
512may vary across platforms; consider documenting why this value was chosen or extracting it into a named constant.
const expectedMinAllocSize = 512
No description provided.