Skip to content
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

Fix test data #261

Merged
merged 1 commit into from
Mar 10, 2024
Merged

Fix test data #261

merged 1 commit into from
Mar 10, 2024

Conversation

bearrito
Copy link
Contributor

@bearrito bearrito commented Mar 7, 2024

Fixes: #259

Test Data was missing for the info cmd test.

Since I'm not sure what the original committer did to create the data I created a new cache based off blob2.caibx and blob2.store. I then deleted some of the chunks from the cache. Those are the contents of the checked in cache.

However since the chunks changed some of the expected test values also changed. I'll comment on the files how I checked them.

Now passing locally:


=== RUN   TestInfoCommand
=== RUN   TestInfoCommand/info_command_with_store
--- PASS: TestInfoCommand/info_command_with_store (0.00s)
=== RUN   TestInfoCommand/info_command_with_seed
--- PASS: TestInfoCommand/info_command_with_seed (0.00s)
=== RUN   TestInfoCommand/info_command_with_seed_and_cache
--- PASS: TestInfoCommand/info_command_with_seed_and_cache (0.00s)
=== RUN   TestInfoCommand/info_command_with_cache
--- PASS: TestInfoCommand/info_command_with_cache (0.00s)
--- PASS: TestInfoCommand (0.00s)
PASS
ok      github.com/folbricht/desync/cmd/desync  0.009s




@@ -55,11 +56,11 @@ func TestInfoCommand(t *testing.T) {
"unique": 131,
"in-store": 131,
"in-seed": 124,
"in-cache": 18,
"not-in-seed-nor-cache": 5,
"in-cache": 25,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is easy to verify by hand. Count the number of files in the cache.

"size": 2097152,
"dedup-size-not-in-seed": 80029,
"dedup-size-not-in-seed-nor-cache": 67099,
"dedup-size-not-in-seed-nor-cache": 80029,
Copy link
Contributor Author

@bearrito bearrito Mar 7, 2024

Choose a reason for hiding this comment

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

This I had to accept on faith. The mixing of seed1 makes it difficult to know what chunks were shared.

"size": 2097152,
"dedup-size-not-in-seed": 1114112,
"dedup-size-not-in-seed-nor-cache": 950410,
"dedup-size-not-in-seed-nor-cache": 853943,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For this I took the total value as 1114112.

I then traversed the blob2.cache and summed up the decompressed chunk sizes. That size was 260169
The difference between those values is 853943

Copy link
Owner

@folbricht folbricht left a comment

Choose a reason for hiding this comment

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

Thank you

@folbricht folbricht merged commit 3ffe462 into folbricht:master Mar 10, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing Command Unit Tests
2 participants