Skip to content

test: add end-to-end test for CDC chunk compression#864

Merged
kalbasit merged 2 commits intomainfrom
02-11-test_add_e2e_cdc_compression_test
Feb 12, 2026
Merged

test: add end-to-end test for CDC chunk compression#864
kalbasit merged 2 commits intomainfrom
02-11-test_add_e2e_cdc_compression_test

Conversation

@kalbasit
Copy link
Owner

@kalbasit kalbasit commented Feb 12, 2026

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.

During the test, it was discovered that the compressed size was not written to the database. This was fixed.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 12, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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

  • Compression Verification: Ensures that Content-Defined Chunking (CDC) chunks are transparently compressed using ZSTD before storage.
  • Metadata Tracking: Confirms that the 'compressed_size' is accurately tracked in the database for compressed chunks.
  • Data Integrity: Validates that data reassembly (GetNar) is transparent and returns the original decompressed content, maintaining data integrity.
Changelog
  • pkg/cache/cdc_test.go
    • Added a new test case "testCDCChunksAreCompressed" to validate end-to-end ZSTD compression for CDC chunks.
    • Registered the new test case within the "runCDCTestSuite".
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@dosubot
Copy link

dosubot bot commented Feb 12, 2026

Related Documentation

Checked 7 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@dosubot dosubot bot added enhancement New feature or request go Pull requests that update go code labels Feb 12, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

@kalbasit kalbasit force-pushed the 02-11-feat_add_zstd_compression_to_s3_chunk_store branch from a467841 to 1005205 Compare February 12, 2026 05:37
@kalbasit kalbasit force-pushed the 02-11-test_add_e2e_cdc_compression_test branch from 08574be to 86f0d2b Compare February 12, 2026 05:37
@kalbasit kalbasit force-pushed the 02-11-test_add_e2e_cdc_compression_test branch from 86f0d2b to a87eda2 Compare February 12, 2026 06:15
@kalbasit kalbasit force-pushed the 02-11-feat_add_zstd_compression_to_s3_chunk_store branch 2 times, most recently from 3da748c to 8c899c5 Compare February 12, 2026 06:37
@kalbasit kalbasit force-pushed the 02-11-test_add_e2e_cdc_compression_test branch 2 times, most recently from 1c56a4c to c058ccc Compare February 12, 2026 06:56
@kalbasit kalbasit force-pushed the 02-11-feat_add_zstd_compression_to_s3_chunk_store branch from 8c899c5 to 0afaa04 Compare February 12, 2026 06:56
@kalbasit kalbasit force-pushed the 02-11-test_add_e2e_cdc_compression_test branch from c058ccc to 6ca79e5 Compare February 12, 2026 07:22
@kalbasit kalbasit force-pushed the 02-11-feat_add_zstd_compression_to_s3_chunk_store branch from 0afaa04 to 68c548b Compare February 12, 2026 07:22
@kalbasit kalbasit force-pushed the 02-11-test_add_e2e_cdc_compression_test branch from 6ca79e5 to 8aa33ef Compare February 12, 2026 07:39
@kalbasit kalbasit force-pushed the 02-11-feat_add_zstd_compression_to_s3_chunk_store branch from 68c548b to 520d156 Compare February 12, 2026 07:39
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Feb 12, 2026
@kalbasit kalbasit force-pushed the 02-11-feat_add_zstd_compression_to_s3_chunk_store branch from 520d156 to eb568cf Compare February 12, 2026 08:32
@kalbasit kalbasit force-pushed the 02-11-test_add_e2e_cdc_compression_test branch from 77b75c4 to 59a0c62 Compare February 12, 2026 08:32
Base automatically changed from 02-11-feat_add_zstd_compression_to_s3_chunk_store to main February 12, 2026 08:42
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.
@kalbasit kalbasit force-pushed the 02-11-test_add_e2e_cdc_compression_test branch from 59a0c62 to a6f7400 Compare February 12, 2026 08:43
@kalbasit kalbasit enabled auto-merge (squash) February 12, 2026 08:44
@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 3.96%. Comparing base (7c5de21) to head (a6f7400).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kalbasit kalbasit merged commit 42ad9bb into main Feb 12, 2026
17 checks passed
@kalbasit kalbasit deleted the 02-11-test_add_e2e_cdc_compression_test branch February 12, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant