Repository navigation
[TEST] ZipArchiveFile: cover unzipDirectory error paths (#9460) - #9540
timosachsenberg merged 4 commits into
Conversation
ZipArchiveFile_test only exercised the happy path (add + extract a valid archive). Adds an [EXTRA] section pinning unzipDirectory's error handling -- the whole-archive counterpart to the single-file ZipIfstream corrupt-archive guard: - corrupt archive (existing, readable, but not a valid ZIP) -> Exception::InvalidValue (libzip's zip_open fails; a clear exception rather than a crash) - missing / unreadable input -> Exception::FileNotFound - already-unpacked directory input -> returned as-is (the directory-or-zip bundle convention) Verified: builds clean and the test runs PASSED. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe test file is strengthened in two ways: the existing ChangesZipArchiveFile test improvements
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/tests/class_tests/openms/source/ZipArchiveFile_test.cpp`:
- Around line 92-97: Replace the manual temp file creation for the corrupt
archive test file with the NEW_TMP_FILE macro. Instead of manually constructing
the corrupt file path with tmp.getPath() and creating an ofstream directly, use
NEW_TMP_FILE to generate the temporary file path and handle, then write the
plain text bytes to that file. This ensures consistent temp-file handling across
all tests as per coding guidelines.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 55c11244-4166-4129-b8a1-41d3483707c7
📒 Files selected for processing (1)
src/tests/class_tests/openms/source/ZipArchiveFile_test.cpp
|
@timosachsenberg The following names might be missing from the
Please consider applying the following patch: --- AUTHORS 2026-06-15 17:17:21.710863983 +0000
+++ AUTHORS.new 2026-06-15 17:17:26.707204139 +0000
@@ -23,8 +23,8 @@
- Chirag Dave
- Chris Bauer
- Chris Bielow
- - Christie Mathews
- Christian Ehrlich
+ - Christie Mathews
- Clemens Groepl
- Cornelia Friedle
- Daniel Jameson |
|
Adversarial review result: I found a compile blocker in the added test.
No source/test comments with tracker-style issue references stood out in this diff. I did not run the tests locally. |
…x build) Co-Authored-By: Claude Opus 4.8 <[email protected]>
What
Adds a
ZipArchiveFile_testsection pinningunzipDirectory's error handling — the whole-archive counterpart to the single-fileZipIfstreamcorrupt-archive guard (#9535):Exception::InvalidValue(libzip'szip_openfails; a clear exception rather than a crash);Exception::FileNotFound;.oswpq/ parquet bundles).Why
Part of the §1 (Qt removal:
minizip-ng → libzip)[AUTO]task in the OpenMS 3.6.0 pre-release testing plan (#9460):ZipArchiveFile_testpreviously only covered the happy path (add a file, extract, verify). I read the implementation to assert the exact thrown types: corrupt →InvalidValue(FileHandler.cpp/ZipArchiveFile.cppzip_openfailure), unreadable →FileNotFound, directory → early return. (#9535 covered theZipIfstreamsingle-file corrupt path, which throwsFileNotReadable; this covers the distinctunzipDirectorywhole-archive path.)Test plan
Tests only — no production code changed. Verified locally:
-fsyntax-onlyclean, full build green, test runs PASSED (InvalidValue/FileNotFound/ directory-returned-as-is allOK).Part of #9460. Follows #9524 … #9539.
🤖 Generated with Claude Code
Summary by CodeRabbit