-
Notifications
You must be signed in to change notification settings - Fork 1
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
Small changes to prep for caching daemon #90
Conversation
42a6646
to
da16b06
Compare
make build | ||
``` | ||
|
||
### Run migrations |
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.
Is this section supposed to have make migrate
instructions?
test/client_get_cache_test.go
Outdated
@@ -49,7 +49,7 @@ func TestClientGetCache(t *testing.T) { | |||
tmpCacheDir, err := os.MkdirTemp("", "dl_cache_test_tmp") | |||
require.NoError(t, err) | |||
|
|||
version, err := c.GetCache(tc.Context(), tmpCacheDir) | |||
version, _, err := c.GetCache(tc.Context(), tmpCacheDir) |
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.
Not a bad idea to add a couple assertions on this value to make sure it's returning what we expect.
keys = append(keys, key) | ||
} | ||
|
||
sort.Strings(keys) |
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.
Damn, this was kind of a consequence of two things:
- Reproducing
packObjects
as a test util instead of using the same function we do in prod - The fact that the prod version of
packObjects
expects a sorted stream and we use amap
for convenience in tests
The prod sorting happens here: https://github.com/gadget-inc/dateilager/blob/main/internal/db/tar.go#L233
da16b06
to
f0fc487
Compare
FYI, I'm going to push commits to this branch |
GetCache
packObjects
test helper produces deterministic hashes by iterating in sorted order