Test ManifestStore against S3 and fix key parsing - #507
Conversation
TomNicholas
left a comment
There was a problem hiding this comment.
This is cool, but I'm not totally sure I understand what you're intending to test here, or how it relates to the ManifestStore work. Surely dealing with remote object storage is the responsibility of obstore and icechunk?
I would like to test that I built this as a separate PR under the assumption that PR scope should be as constrained as possible and that there were some Icechunk tests that would benefit from minio., but didn't pick a good test to start from. I'll modify this PR to test VirtualiZarr/virtualizarr/tests/test_backend.py Lines 206 to 232 in 206277f |
Thanks for the explanation, that makes a lot more sense. I just want to avoid the rabbit hole of adding tests to VirtualiZarr that are really just testing that Icechunk does what it says it does.
FWIW I would be happy to merge your |
Oh wow, that'd make this so much easier! |
| parsed_key = urlparse(request_key) | ||
| return StoreRequest(store=stores[key], key=parsed_key.path) |
There was a problem hiding this comment.
This is the only non-test related change in the PR, which makes the ManifestStore work for both local and object stores
TomNicholas
left a comment
There was a problem hiding this comment.
Nice! This does seem useful.
|
|
||
|
|
||
| @pytest.fixture() | ||
| @requires_obstore |
There was a problem hiding this comment.
Why does this test not require obstore?
There was a problem hiding this comment.
These markers don't make any impact on fixtures, so I removed it. The fixture is generated if any tests using the fixtures are captured by pytest, so the markers should all go on tests rather than fixtures.
| client_options={"allow_http": True}, | ||
| ) | ||
| filepath = "data.tmp" | ||
| obs.put( |
There was a problem hiding this comment.
You only did one put, but now there are 4 chunks in there?
There was a problem hiding this comment.
I added a docstring explaining the approach in 874c6df (#507). This is kinda similar to libraries that concurrently compress each chunk (or not for uncompressed data), concatenate them, and then write then to a file in one go. At least, I think that's a thing.
| @pytest.mark.asyncio | ||
| @pytest.mark.parametrize( | ||
| "manifest_store", | ||
| ["local_store", pytest.param("s3_store", marks=pytest.mark.minio)], |
There was a problem hiding this comment.
Should the mark be requires_minio?
There was a problem hiding this comment.
They're synonymous, but I will re-add requires_minio since it's more descriptive
| "length": 4, | ||
| }, | ||
| } | ||
| manifest = ChunkManifest(entries=chunk_dict) |
There was a problem hiding this comment.
Is there a way to split this fixture up a bit, to more clearly delineate the creation of data in a (minio) s3-like obstore from the creation of the ManifestStore object which contains the byte references pointing to it?
This PR test the ManifestStore against S3 using MinIO and fixes a small issue with translating ManifestArray keys to the appropriate key for
obstore.get().docs/releases.rstapi.rst