Repository navigation
Ensure /tmp folder is clean after a batch test run - #1093
Merged
Merged
Conversation
Set hywiki-directory to prior hywiki-directory when restoring state at and of test cases. Otherwise hywiki-mode recreates the temporary hywiki-directory used in the test. Avoid warnings for deleting non-existing files by not remove files that we know does not exists. Ensure instead that it is verified. * Makefile (verify-clean-test-run): Target that runs checks for left over resources. (test-ert): Use verify-clean-test-run. * test/hywiki-tests.el (hywiki-tests--preserve-hywiki-mode): Store and reset prior hywiki-directory on test completion. Resetting hywiki-mode recreates the temporary hywiki-directory otherwise. * test/hib-social-tests.el (hibtypes-repo-cache-does-not-exist-test): * test/hyrolo-tests.el (hyrolo-tests--rename): * test/hywiki-tests.el (hywiki-tests--edit): Avoid deleting files that does not exist. * test/hywiki-tests.el (hywiki-tests--kill-empty-wiki-buffer): Helper for removing empty hywiki files and trigger a test error if it is not removed when buffer is killed. (hywiki-tests--add-path-link-v2): (hywiki-tests--action-key-on-hywikiword-displays-page): Use hywiki-tests--kill-empty-wiki-buffer.
rswgnu
requested changes
Nov 6, 2026
rswgnu
approved these changes
Nov 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Set hywiki-directory to prior hywiki-directory when restoring state at and of test cases. Otherwise hywiki-mode recreates the temporary hywiki-directory used in the test.
Avoid warnings for deleting non-existing files by not removing files that we know do not exist. Ensure instead that deletion is verified.
Makefile (verify-clean-test-run): Target that runs checks for left over resources.
(test-ert): Use verify-clean-test-run.
test/hywiki-tests.el (hywiki-tests--preserve-hywiki-mode): Store and reset prior hywiki-directory on test completion. Resetting hywiki-mode recreates the temporary hywiki-directory otherwise.
test/hib-social-tests.el (hibtypes-repo-cache-does-not-exist-test):
test/hyrolo-tests.el (hyrolo-tests--rename):
test/hywiki-tests.el (hywiki-tests--edit): Avoid deleting files that do not exist.
test/hywiki-tests.el (hywiki-tests--kill-empty-wiki-buffer): Helper for removing empty hywiki files and trigger a test error if it is not removed when buffer is killed.
(hywiki-tests--add-path-link-v2):
(hywiki-tests--action-key-on-hywikiword-displays-page): Use
hywiki-tests--kill-empty-wiki-buffer.
Why
When working on the test looping issue I noticed that we are leaving many test hywiki-directory in the tmp folder. This PR removes the creation of those test folders.
The reason was that hywiki-mode when restored to its prior state would immediately recreate the hywiki-directory. The PR solves the issue by remembering the prior directory and set that before switching to the prior state of hywiki-mode. (If that is the proper long term solution is another questions. It can easily be rolled back.)
The PR also adds a check target run at the end of the batch tests where the tmp folder is checked for unwanted garbage left by the tests. Presently it just checks for hywiki test folders; further tests can be added when we feel the need.
There are also some small fixes that remove warnings when trying to delete previously removed files. The warning should likely be turned into an error but that is for another PR.