Skip to content

Add combinatorial regression tests for mk_dirs_if_missing (closes #14)#75

Merged
thorwhalen merged 1 commit into
masterfrom
test/issue14-mk-dirs-if-missing
Jul 5, 2026
Merged

Add combinatorial regression tests for mk_dirs_if_missing (closes #14)#75
thorwhalen merged 1 commit into
masterfrom
test/issue14-mk-dirs-if-missing

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

What

#14 reported two mk_dirs_if_missing fragilities. 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)FileNotFoundError repro):

s = mk_dirs_if_missing(Files)(nonexistent_dir)
list(s)      # []          (was: FileNotFoundError)
len(s)       # 0
'x' in s     # False
s['missing'] # KeyError     (was: a "directory doesn't exist" error)

2. Wrap-orderingmk_dirs_if_missing(wrap_kvs(G)) (which raised FileNotFoundError: '') 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-1 wrap_kvs work 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); and mk_dirs(JsonFiles) value-transform composition.

Minor known residual (not blocking): the KeyError on 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 core Files decorator, so it's left for a separate change.

Closes #14

https://claude.ai/code/session_01H8PmV6xmMhzV64zi1Twraw

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
@thorwhalen thorwhalen merged commit 2d79703 into master Jul 5, 2026
12 checks passed
@thorwhalen thorwhalen deleted the test/issue14-mk-dirs-if-missing branch July 5, 2026 14:24
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.

mk_dirs_if_missing fragilities

1 participant