emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Morgan Smith <Morgan.J.Smith@outlook.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Testing: Ensure 'org-id-locations-file' is set before updating
Date: Tue, 18 Jul 2023 12:40:16 -0400	[thread overview]
Message-ID: <DM5PR03MB316333DCE671ED9D89C73AD3C538A@DM5PR03MB3163.namprd03.prod.outlook.com> (raw)

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



             reply	other threads:[~2023-07-18 16:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-18 16:40 Morgan Smith [this message]
2023-07-19  8:04 ` [PATCH] Testing: Ensure 'org-id-locations-file' is set before updating Ihor Radchenko
2023-08-12  9:29 ` Ihor Radchenko
2023-08-12 14:26   ` Max Nikulin
2023-08-13  8:30     ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM5PR03MB316333DCE671ED9D89C73AD3C538A@DM5PR03MB3163.namprd03.prod.outlook.com \
    --to=morgan.j.smith@outlook.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).