Add combinatorial regression tests for mk_dirs_if_missing (closes #14)#75
Merged
Merged
Conversation
Issue #14 reported two mk_dirs_if_missing fragilities; both are resolved on current dol (the wrap-ordering one dissolved once the wrap_kvs convention settled, as the triage predicted). This adds the "combinatorial wrapper testing" the issue asked for, to lock the behavior in: - read ops on a fresh store whose root dir doesn't exist yet: list -> [], len -> 0, `in` -> False, __getitem__ -> KeyError (not a filesystem error); - mk_dirs_if_missing composes with wrap_kvs in BOTH orders (mk_dirs(wrap_kvs(G)), which used to raise `FileNotFoundError: ''`, now works), plus JsonFiles value transforms, deep new-key subdir creation, and nested mk_dirs. Closes #14 Claude-Session: https://claude.ai/code/session_01H8PmV6xmMhzV64zi1Twraw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
#14 reported two
mk_dirs_if_missingfragilities. Both are resolved on current dol — verified by running the issue's exact repros — so this PR adds the combinatorial wrapper testing the issue explicitly asked for, to lock the behavior in.Verified resolved
1. Read ops on a fresh store whose root dir doesn't exist yet (the issue's
list(s)→FileNotFoundErrorrepro):2. Wrap-ordering —
mk_dirs_if_missing(wrap_kvs(G))(which raisedFileNotFoundError: '') now works, as does every other ordering. The triage predicted this ("the ordering fragility may partly dissolve once the wrapping convention is settled") — it did, once the Wave-1wrap_kvswork landed.Tests (7, cross-platform)
Read-ops-on-missing-dir; the 5 wrap orderings (
mk_dirs(Files),mk_dirs(G),wrap_kvs(mk_dirs(G)),mk_dirs(wrap_kvs(G)),mk_dirs(mk_dirs(Files))) each writing a root key and a deep new-key path (subdir creation); andmk_dirs(JsonFiles)value-transform composition.Minor known residual (not blocking): the
KeyErroron a missing key carries the raw FS message ([Errno 2] No such file...) rather than naming the key — the exception type is correct (the issue's ask), only the message is cosmetic. Cleaning it touches a 24-dependent coreFilesdecorator, so it's left for a separate change.Closes #14
https://claude.ai/code/session_01H8PmV6xmMhzV64zi1Twraw