test: add end-to-end test for CDC chunk compression#864
Conversation
Summary of ChangesHello @kalbasit, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new end-to-end test case to the CDC test suite. The primary goal is to verify the correct functioning of ZSTD compression for Content-Defined Chunking (CDC) when chunks are stored in local or S3 chunk stores. It ensures that data is compressed effectively, metadata is updated, and the original content can be transparently retrieved. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds an end-to-end test for CDC chunk compression. The new test testCDCChunksAreCompressed is a good addition to verify the compression feature. However, the test as implemented is incomplete. It checks for the creation of chunks but fails to verify the core aspect of compression: that the stored chunks are actually smaller than the original data and that the compressed size is tracked correctly in the database. I've provided a suggestion to enhance the test to perform these crucial validations. With this improvement, the test will provide much stronger guarantees about the correctness of the CDC compression feature.
a467841 to
1005205
Compare
08574be to
86f0d2b
Compare
86f0d2b to
a87eda2
Compare
3da748c to
8c899c5
Compare
1c56a4c to
c058ccc
Compare
8c899c5 to
0afaa04
Compare
c058ccc to
6ca79e5
Compare
0afaa04 to
68c548b
Compare
6ca79e5 to
8aa33ef
Compare
68c548b to
520d156
Compare
520d156 to
eb568cf
Compare
77b75c4 to
59a0c62
Compare
This commit adds a new test case 'testCDCChunksAreCompressed' to the CDC test suite in pkg/cache/cdc_test.go. This test verifies that when Content-Defined Chunking (CDC) is enabled, chunks are transparently compressed using ZSTD before being stored in the chunk store. Key validations: - Chunks are stored with the expected compression. - The 'compressed_size' is correctly tracked in the database. - Data reassembly (GetNar) is transparent and returns the original decompressed content. This ensures that the recent ZSTD compression features for Local and S3 chunk stores are working correctly in an end-to-end workflow.
59a0c62 to
a6f7400
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #864 +/- ##
=====================================
Coverage 3.96% 3.96%
=====================================
Files 6 6
Lines 429 429
=====================================
Hits 17 17
Misses 409 409
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|

This commit adds a new test case 'testCDCChunksAreCompressed' to the CDC test suite in pkg/cache/cdc_test.go.
This test verifies that when Content-Defined Chunking (CDC) is enabled, chunks are transparently compressed using ZSTD before being stored in the chunk store.
Key validations:
This ensures that the recent ZSTD compression features for Local and S3 chunk stores are working correctly in an end-to-end workflow.
During the test, it was discovered that the compressed size was not written to the database. This was fixed.