[IMPROVEMENT] Zstd: Contract and test coverage for ZstdBlobStoreDAO atop file and memory implementations - #3199
Conversation
…top file and memory implementations Following PMC feedback regarding ZstdBlobStoreDAO working out of the box atop the file implementation: - Extract ZstdBlobStoreDAOContract interface extending BlobStoreDAOContract and MetadataAwareBlobStoreDAOContract. - Add ZstdFileBlobStoreDAOTest verifying ZstdBlobStoreDAO works out of the box atop FileBlobStoreDAO. - Add ZstdMemoryBlobStoreDAOTest for lightweight in-memory contract verification without requiring Docker. - Refactor ZstdBlobStoreDAOTest to implement ZstdBlobStoreDAOContract against S3BlobStoreDAO. - Add File and Postgres BlobStore module choosing tests in BlobStoreModulesChooserTest.
chibenwa
left a comment
There was a problem hiding this comment.
(Just need ICLA reception)
My concern was not necessarily about the DAO compatibility (which is possible through the BlobStoreDAOMetadataContract) but more about guice wiring. But those tests do not hurt. |
So i have to sign this https://www.apache.org/licenses/icla.pdf and then send to secretary@apache.org right ? |
Yes Fill with PDF for automate reading and sign a separated paper.
|
Done |
|
Thanks a lot for this first contribution. Wishing you to be able to contribute many more! Best regard, Benoit |
Context & Motivation
Following the discussion on #3193 regarding
ZstdBlobStoreDAOrunning atop non-S3 storage layers, @chibenwa noted:Prior to this change:
ZstdBlobStoreDAOTestinserver/blob/blob-zstdwas hardcoded toS3BlobStoreDAOand required spinning up a Docker AWS S3 container (DockerAwsS3Extension).ZstdBlobStoreDAOoperates correctly atopFileBlobStoreDAO(orMemoryBlobStoreDAO).BlobStoreModulesChooserTestinjames-server-guice-distributedtested S3 and Cassandra module resolution, but lacked test coverage forfile()andpostgres()implementations.Solution Overview
Extracted
ZstdBlobStoreDAOContract:org.apache.james.blob.zstd.ZstdBlobStoreDAOContractextendingBlobStoreDAOContractandMetadataAwareBlobStoreDAOContract.Added
ZstdFileBlobStoreDAOTest:ZstdBlobStoreDAOdirectly atopFileBlobStoreDAObacked byFileSystemImpl.forTesting().FileBlobStoreDAO's user-defined extended attributes (UserDefinedFileAttributeView) correctly store and propagateContentEncoding.ZSTDandcontent-original-sizemetadata out of the box.Added
ZstdMemoryBlobStoreDAOTest:ZstdBlobStoreDAOatopMemoryBlobStoreDAO.Refactored
ZstdBlobStoreDAOTest:ZstdBlobStoreDAOTestnow implementsZstdBlobStoreDAOContractforS3BlobStoreDAO(retaining full Docker S3 integration coverage while reducing boilerplate from 454 lines down to 88 lines).Enhanced
BlobStoreModulesChooserTest:BlobStoreModulesChoosercorrectly selectsFileBlobStoreDAODeclarationModuleandPostgresBlobStoreDAODeclarationModule.Verification & Tests
server/blob/blob-zstd:ZstdFileBlobStoreDAOTest: 109 / 109 tests passed (100%)ZstdMemoryBlobStoreDAOTest: 109 / 109 tests passed (100%)ZstdBlobStoreDAOTest(S3 + Testcontainers): 110 / 110 tests passed (100%)server/container/guice/distributed:BlobStoreModulesChooserTest: 8 / 8 tests passed (100%)