emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Testing: Ensure 'org-id-locations-file' is set before updating
@ 2023-07-18 16:40 Morgan Smith
  2023-07-19  8:04 ` Ihor Radchenko
  2023-08-12  9:29 ` Ihor Radchenko
  0 siblings, 2 replies; 5+ messages in thread
From: Morgan Smith @ 2023-07-18 16:40 UTC (permalink / raw)
  To: emacs-orgmode

Previously, when trying to run the tests in a container limited to the
org repository, it fails because it can't create the directory
"~/.emacs.d/.org-id-locations".

* testing/org-test.el (org-test-load): Move setting
'org-id-locations-file' from here ...
org-test-update-id-locations: ... to here
---

Hello!  This fix allows me to run the tests without giving it access to the
filesystem outside of the repository.  I have no clue what org-id-locations are
and I'm hoping someone else does so I don't have to learn.  I'm not sure if
this is the best fix, but it works.

 testing/org-test.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testing/org-test.el b/testing/org-test.el
index 47687b9f7..3f086f30c 100644
--- a/testing/org-test.el
+++ b/testing/org-test.el
@@ -387,8 +387,6 @@ Tramp related features.  We mostly follow
 (defun org-test-load ()
   "Load up the Org test suite."
   (interactive)
-  (setq org-id-locations-file
-        (expand-file-name ".test-org-id-locations" org-test-dir))
   (cl-flet ((rld (base)
 	         ;; Recursively load all files, if files throw errors
 	         ;; then silently ignore the error and continue to the
@@ -447,6 +445,8 @@ Tramp related features.  We mostly follow
       (when (buffer-live-p b) (kill-buffer b)))))
 
 (defun org-test-update-id-locations ()
+  (setq org-id-locations-file
+        (expand-file-name ".test-org-id-locations" org-test-dir))
   (org-id-update-id-locations
    (directory-files
     org-test-example-dir 'full
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-08-13  8:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-18 16:40 [PATCH] Testing: Ensure 'org-id-locations-file' is set before updating Morgan Smith
2023-07-19  8:04 ` Ihor Radchenko
2023-08-12  9:29 ` Ihor Radchenko
2023-08-12 14:26   ` Max Nikulin
2023-08-13  8:30     ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).