Skip to content

test(core): add hfile compression codec coverage - #622

Merged
yihua merged 3 commits into
apache:mainfrom
slfan1989:hudi-621
Sep 3, 2026
Merged

yihua merged 3 commits into
apache:mainfrom
slfan1989:hudi-621

Conversation

@slfan1989

Copy link
Copy Markdown
Contributor

Description

Add dedicated unit test coverage for the HFile compression codec implementation in
crates/core/src/hfile/compression.rs.

The new tests cover:

  • mapping supported HFile compression codec IDs to CompressionCodec variants
  • rejecting an unknown codec ID with HFileError::UnsupportedCompression
  • returning input bytes unchanged for the None codec
  • successfully decompressing a GZIP payload
  • returning an error for an invalid GZIP payload
  • returning explicit unsupported-codec errors for LZO, Snappy, LZ4, BZIP2, and ZSTD

This is a test-only change and does not modify production behavior.

Closes #621.

How are the changes test-covered

  • N/A
  • Automated tests (unit and/or integration tests)
  • Manual tests
  • Details are described below

Added six unit tests covering codec ID parsing, successful decompression paths, and error handling paths in the HFile compression module.

@slfan1989
slfan1989 requested a review from xushiyan as a code owner May 24, 2026 08:59
@slfan1989 slfan1989 changed the title test(core): add hfile compression codec coverage. test(core): add hfile compression codec coverage May 24, 2026
@codecov

codecov Bot commented May 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.43%. Comparing base (59e4643) to head (27e2e66).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #622      +/-   ##
==========================================
+ Coverage   79.28%   79.43%   +0.14%     
==========================================
  Files         126      126              
  Lines       12311    12311              
==========================================
+ Hits         9761     9779      +18     
+ Misses       2550     2532      -18     

☔ View full report in Codecov by Harness.
📢 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.

@slfan1989

Copy link
Copy Markdown
Contributor Author

@yihua @xushiyan Could you please help review this PR? Thank you very much!

@yihua yihua left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. @slfan1989 Thanks for the contribution!

@yihua
yihua merged commit 67640b5 into apache:main Sep 3, 2026
16 checks passed
@yihua yihua added this to the release-0.5.0 milestone Sep 3, 2026
@yihua yihua mentioned this pull request Sep 5, 2026
16 tasks done
@slfan1989

Copy link
Copy Markdown
Contributor Author

@yihua Thanks so much for reviewing my code!

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.

Add unit test coverage for HFile compression codecs

2 participants