Skip to content

Ensure /tmp folder is clean after a batch test run - #1093

Merged
matsl merged 2 commits into
masterfrom
pr_cleanup_undeleted_resources
Nov 8, 2026
Merged

matsl merged 2 commits into
masterfrom
pr_cleanup_undeleted_resources

Conversation

@matsl

@matsl matsl commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

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.

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.
@matsl
matsl requested a review from rswgnu November 4, 2026 23:11
Comment thread ChangeLog Resolved
@matsl
matsl requested a review from rswgnu November 6, 2026 23:53
@matsl
matsl merged commit f5b3791 into master Nov 8, 2026
5 checks passed
@matsl
matsl deleted the pr_cleanup_undeleted_resources branch November 8, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants