Copy link
@basil-conto

basil-conto May 6, 2019

Collaborator

But having the whole directory readily available for manual interaction / debugging is also a plus.

That's still possible, even if the directory is created on the fly. First, ERT tests support interactive debugging. Second, if you replace the unwind-protect I mentioned earlier with (condition-case err ... (ert-test-failed ...)), then the test directory can be left around for further debugging instead of being unconditionally deleted.

Additionally, further tests might be added with non-empty files.

Again, something that can either be created on the fly, or live permanently on the same branch as the tests.

Keep everything in master; use .ignore and counsel-rg for selecting the file list.

As long as this is customisable, sure.

Have the master git branch be the dependency of test instead of the other way around.

I think it's neither necessary, clean, nor a good idea for branches to depend on each other like this. Git branches are meant for self-contained and independent project state. Otherwise, they can go out of sync, and then you have two (or more) problems, not just one. What if a new development branch is created to test some new feature? Then it might also need its own test branch.

When one checks out a branch, its docs, code, and tests should all be consistent with one another, and no further checkouts should be required, especially not checking out one branch of the same repository as a subdirectory of another branch, just for the sake of a smaller file list. This is an abuse of Git branches. You could achieve a similar effect with Git submodules, but that's still bad organisation, as submodules can be pushed independently of their parent.

The current approach also helps us avoid including large files into the master branch. Suppose in the future we add a performance test to swiper with a 1Mb file. Then it's better to not pollute the master branch with it.

Why does the file's size matter? The 1MB file will be stored in your repository in one way or another. I don't understand your reservations against "polluting" the file list when the current approach of checking out a separate branch as a subdirectory also pollutes the file list.

In conclusion, test files should either live permanently in the same branch as the code testing them, or should be created by said tests on the fly. If you don't want to see data files during file name completion, just add their directory to the appropriate ignore list.