-
-
Notifications
You must be signed in to change notification settings - Fork 329
refactor core tests #1305
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
refactor core tests #1305
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1305 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 35 35
Lines 14404 14111 -293
==========================================
- Hits 14404 14111 -293
|
another change worth noting: in this PR, |
Thanks so much @d-v-b for taking some time to pay down some technical debt and improve our test suite! 🙏 I can't quite tell how much this is WIP, but I'd be happy to review this when you're ready for feedback. Please just request me as a reviewer. |
@rabernat i'm coming back from a vacation with energy to push this forward. In therms of WIP-ness, all I need to do is check code coverage and then it's ready, assuming the maintainers agree with the strategy behind this compaction of the test suite. |
At a high-level, the strategy sounds good to me. Minor nitpick: for large(-ish) refactors, adding e.g. the switch from Edit: No worries beyond codecov. 👍 |
I'm formatting with |
I agree with Josh here. Changes in our linting should be introduced as standalone PRs, without mixing in any other changes. Otherwise it's extremely hard to review. I think we should be running Black (or even better, Ruff) on Zarr. But this PR is about refactoring our test suite. Let's not make it any harder than it has to be. Edit with a hopefully more productive suggestion: one path forward that would not require @d-v-b to somehow un-black his changes would be to create a separate PR that runs black on the whole code base and introduces this into the pre-commit workflow, merge, and then rebase this PR on top of that. Then reviewers would be able to focus on the actual test refactor changes (rather than formatting changes), AND we would get the benefits of a black-ed codebase. |
For @jstriebel's sanity I would very much like to get the sharding PRs in before we reformat everything. |
apologies for prematurely formatting the code -- it did make development easier, but I didn't anticipate the cost of the noisy diff |
see #1321 for a blackened, ruff-approved |
…ython into refactor_core_tests
this diff 56d23b6 is against a formatted test suite, so it's not an atrocious diff. Let me know if there's more I can do to make this easier for review, and sorry for the noisy commits. There's some drops in coverage that I would like to resolve before merging this. |
Thanks for doing this! ❤️ Only issues that pop out:
💯 since the state propagates to other PRs based off the same mainline. |
The ones I removed are from
All of the test classes vary in two places: the values passed to This results in smaller class definitions -- in this PR, many classes only override Thus the hierarchy is actually unchanged or simplified -- |
Some recent changes:
|
Argh. Apologies, @d-v-b, I assume the sharding PR led to conflicts as feared. |
closing this in favor of a new effort: #1462 |
This PR refactors the array API tests in
test_core.py
by adding two methods toTestArray
,create_store
andcreate_chunk_store
. These methods are called byTestArray.create_array
to generate a test-class-specificstore
andchunk_store
instances.Nearly all the variability across test classes can be expressed as different implementations of
create_store
, so test classes no longer need their own implementation ofcreate_array
, which cuts down the size of each test class.Different test classes use a variety of different arguments to
create_array
; these variables are now class attributes which are referenced increate_array
.I see this PR as an opportunity for additional simplification of the test suite, so feel free to add suggestions.
TODO: