Closed Pegasust closed 1 year ago
Double nice! I've tangentially notices the cached failure problem but thought it would have been an operator error of mine. :smile:
Thanks also for the feature addition.
Merged in 3dca8edd82ff100878ff0797f67abda629ca8686 (with some sqashing)
Overriding
[dir]
This allows you to put in
snap-dir
Consider that your repo wants to have everything nix (apart from flake.nix) to be in nix/ or contrib/, maybe due to some kind of code ownership system.
You now have the option to put snapshots inside of the respective
[dir]
Dealing with changing snapshots in std
Here's the reproducing bash that this change allows.
```bash rm -rf tests/_snapshots git add tests/ # (all fine) std //tests/checks/snapshots:check ```
``` ------------------------------------------------------------------ Executing /Users/Correctness
Basically
check = namaka.lib.load {...};
actually just returns{}
and relies heavily on the tracing and assertion system of Nix.Since
nix eval
realizes.check
anyways (andnamaka.lib.load
only traces its managed hierarchy), there's realistically no difference on thenix eval
to include.check
or not, we just need to make sure:std
is able to do its mapping magicThe
std
magic to pass this around into./#${system}.${cell}.${cellBlock}.snapshots.check
gets the error assertion in case of snapshot mismatch (or non-existence), which prevents thestd
magic to finish, resulting in obscure error message.Removing
.check
lets this go through tonix eval
, which still prints the correcttrace: namaka={JSON as if we index inside .check}
and to be compared with the correct snapshot path fromnamaka.lib.load
.