Test runs leave their data directory in the system temp dir #8
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose (fix): a test run leaves no data directory behind in the system temp dir.
Refs #4
The defect
config/runtime.exs:11-18(maina93a8b7) pointsMCL_DATA_DIRatSystem.tmp_dir!()/mcl_bookclub_test_<unique>on every:testrun, and nothing removes the directory. Eachmix testleaves one behind: the facade's sqlite and, since #4 PR 1 (forge PR 7), the reckon-db store files too. They pile up on a developer's machine and on a long-lived runner.Found by Uranus in the review of #4 PR 1.
Constraint
reckon-db binds one Ra system per store id to the directory it first opened, for the life of the VM (
test/support/test_store.ex, PR 7). So the directory can only go once the VM's tests are done, never between modules.Fix shape
Remove the directory once the whole run is finished. One way is
ExUnit.after_suite/1in each app'stest_helper.exs, removingMCL_DATA_DIRwhen its basename carries themcl_bookclub_test_prefix runtime.exs gave it. The cleanup must never remove a directory that the test config did not create.Done when
mix test, umbrella or single app, nomcl_bookclub_test_*directory from that run is left in the temp dirMCL_DATA_DIRis never touched