-
-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve test coverage for storage classes #2693
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, big 👍 for improving our testing.
Two major points:
- Since
StoreTests
is public API, we should carefully document everything that's been changed/added in the release notes. I added some comments on this PR inline to changes I spotted that need a release note. - Like @d-v-b, I am confused by Improve test coverage for storage classes #2693 (comment) - would be good to discuss/resolve that comment
@@ -135,6 +154,26 @@ async def test_get(self, store: S, key: str, data: bytes, byte_range: ByteReques | |||
expected = data_buf[start:stop] | |||
assert_bytes_equal(observed, expected) | |||
|
|||
async def test_get_not_open(self, store_not_open: S) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is also surprising to me!
@d-v-b @jhamman could I join the developers meeting tomorrow to discuss the Store open and set behavior (xref #2688)? |
Labeler is fixed now on main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the changelog updates! I added a couple of minor suggestions. I think https://github.com/zarr-developers/zarr-python/pull/2693/files#r1913045841 is an outstanding question that still needs resolving too?
Other than that, is this ready to go from your point of view @maxrjones?
Co-authored-by: David Stansby <[email protected]>
Thanks! Yes, I believe this is ready to go aside from the open questions about |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for doing this @maxrjones. This is a great improvement AND exposes some rough edges in our store API. The good news there is that I think there are some relatively easy improvements we can make to clean up those rough edges.
This PR improves the test coverage for the various storage classes. While testing the storage classes, I fixed a few issues:
open()
forLoggingStore
_is_open
property and setter forWrapperStore
stdout
rather thanstderr
as the default stream forLoggingStore
ZipStore
is open before getting or setting any valuesLoggingStore
andWrapperStore
such that the types much be equal. This is an opinionated change. For example, previously a LocalStore and LoggingStore instance could be evaluated as equal, whereas now they are distinct.Here's the change in coverage:
src/zarr/storage/memory.py
coverage is low because it includes the GPUStore and I don't have a test environment with cuda. I'm opening this PR now even though it's not at 100% coverage because I don't expect to have much time to work on it during the week and would rather the PR not get stale if the team has time for a review.The set partial values methods are addressed separately because they require discussion (xref #2688).