Skip to content

Unfiltering tests and cleaning up edge-cases #105

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

Merged
merged 5 commits into from
Jun 20, 2025
Merged

Conversation

krisfed
Copy link
Member

@krisfed krisfed commented Jun 12, 2025

Several minor changes (mostly resulting from going over all the tests that were filtered or commented out):

  1. Change in behavior for fill value. Previously the fill value was silently cast to the dataset's datatype. This could sometimes result in unexpected/xBuggy behavior. E.g.:
>> zarrcreate("mygroup/myzarr", [1,2], Datatype="uint8", FillValue=-9)
>> d = zarrread("mygroup/myzarr")
 
d =
 
  1×2 uint8 row vector
 
   0   0   % not -9 because -9 cannot be represented with unsigned int

With this change, users will have to explicitly cast their fill value to the datasets datatype (which is more cumbersome, but avoids wrong expectations). A bit on the fence about this change, so let me know if you prefer the original approach.

The mismatch in the fill value datatype will now result in a new MATLAB:zarrcreate:invalidFillValueType error.
Also un-filtering and updating the corresponding tZarrCreate/invalidFillValue test.

  1. Ensuring the dataset size cannot include zeros or be empty. Un-filtering and updatingtZarrCreate/invalidSizeInput test.

  2. Ensuring the chunk size cannot include zeros or be empty. Un-filtering and updating tZarrCreate/invalidChunkSize test.

  3. Making extractS3BucketNameAndPath into a static method. It is a helper method that does not use anything instance-specific - making it static will allow to unit-test it (see Add test to lock pattern verification for cloud-storage workflows #88 ).

  4. Un-filtering and updating tZarrAttributes/verifyArrayAttributeInfo and tZarrAttributes/verifyAttrOverwrite tests (see Attribute transpose and type change behavior looks incorrect #34 - due to JSON limitations, the round-trip of attribute data is imperfect, so we should just capture the current behavior instead of keeping the tests filtered).

  5. Adding tZarrCreate/createDefaultArray test - I don't think we were previously capturing the behavior of which default attributes zarrcreate generates.

Copy link

codecov bot commented Jun 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.72%. Comparing base (1ad7173) to head (249c0e1).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #105      +/-   ##
==========================================
+ Coverage   96.66%   96.72%   +0.06%     
==========================================
  Files           8        8              
  Lines         210      214       +4     
==========================================
+ Hits          203      207       +4     
  Misses          7        7              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@krisfed krisfed marked this pull request as ready for review June 12, 2025 17:12
@krisfed krisfed requested review from jm9176 and jhughes-mw June 12, 2025 17:12
Copy link
Member

@jm9176 jm9176 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating the tests.

krisfed added 3 commits June 18, 2025 15:44
…B-support-for-Zarr-files into tests-edge-cases

tests-edge-cases were merged with updated main online, now need to merge with those changes
@krisfed krisfed merged commit c2f9646 into main Jun 20, 2025
6 checks passed
@krisfed krisfed deleted the tests-edge-cases branch June 20, 2025 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants