-
-
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
base: main
Are you sure you want to change the base?
Conversation
this looks great, I had some minor suggestions. |
Co-authored-by: Davis Bennett <davis.v.bennett@gmail.com>
Co-authored-by: Davis Bennett <davis.v.bennett@gmail.com>
Thanks for this, and thanks for fixing some issues along the way! For the user-facing issues you fixed, can you add a short entry in |
For sure, I'm hoping to find time to address the remaining comments within the next day or two. I'll add release notes at that time. |
Co-authored-by: Davis Bennett <davis.v.bennett@gmail.com>
Co-authored-by: Davis Bennett <davis.v.bennett@gmail.com>
Co-authored-by: Davis Bennett <davis.v.bennett@gmail.com>
Co-authored-by: Davis Bennett <davis.v.bennett@gmail.com>
I believe that I've addressed all the suggestions (thank you for the review, Davis!), except that I will need to wait on clarification about the expected behavior for get/set on closed stores before any final changes/changelog additions. |
I don't think my questions about |
Sounds good, thanks. There's still a couple new untested lines still in this PR - I should have time to fix that tomorrow morning. |
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
"""Kwargs for instantiating a store""" | ||
... | ||
|
||
@abstractmethod |
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.
Could these new abstract methods get a changelog entry? I also presume this is a breaking change, because anyone implementing a child of StoreTests
will now be forced to implement these methods?
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, I can mention it in the changelog entry. I do not consider this a breaking change because the previous 'NotImplementedError' caused these tests to fail unless they were implemented in the inheriting class. I think this is just a more Pythonic way to indicate that they need to be implemented.
@@ -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)? |
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).