Right now, it's hard to figure out which snapshot or status folder belongs to which test because we know the tests by name rather than by ID (e.g 9827922548ee).
This is a problem when doing some cleanup due to tests being renamed or removed but this can be addressed by a clean subcommand (#58).
There are other situations where it's nice to navigate test snapshots by name by directly inspecting the file system.
I still think unique test IDs are useful because they're compact and easy to copy-paste. They don't require escaping special characters to accommodate the file system.
Ideas:
adopt a convention for turning any test name into a file name in a way that works on all platforms. It might end up using only a subset of ASCII, similar to what Alcotest uses.
maintain a hierarchy of folders corresponding to categories and test names.
symlink test names to test IDs. Issue: snapshots as still identified by their ID, so when git shows a change in a snapshot, it doesn't tell us the test name.
symlink test IDs to test names. Use ID-based paths as short paths in the output of testo. This has the advantage of using name-based snapshots whose changes are easier to track with git.
a way of recovering the test name from the snapshot folder is for the test to print its own name. This could be done automatically by the framework, for example by printing the test name into a standard file e.g. tests/snapshots/semgrep-core/aaadc9ccf052/info.txt. Implementing this is straightforward.
Right now, it's hard to figure out which snapshot or status folder belongs to which test because we know the tests by name rather than by ID (e.g
9827922548ee
).This is a problem when doing some cleanup due to tests being renamed or removed but this can be addressed by a
clean
subcommand (#58).There are other situations where it's nice to navigate test snapshots by name by directly inspecting the file system.
I still think unique test IDs are useful because they're compact and easy to copy-paste. They don't require escaping special characters to accommodate the file system.
Ideas:
tests/snapshots/semgrep-core/aaadc9ccf052/info.txt
. Implementing this is straightforward.