aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2022-07-10 18:13:50 +0200
committerMichael Albinus2022-07-10 18:13:50 +0200
commit4bab499ed0d40d4e5ca68e5a17bcf5341125f734 (patch)
tree4b868953b350a84dba54a05cc3e36185a7223c40
parentf8de0d5436adbfe3e83e358c08d4367c65951212 (diff)
downloademacs-4bab499ed0d40d4e5ca68e5a17bcf5341125f734.tar.gz
emacs-4bab499ed0d40d4e5ca68e5a17bcf5341125f734.zip
Fix Tramp test environment on hydra.nixos.org
* lisp/emacs-lisp/ert-x.el (tramp-remote-path): Declare. Adapt `tramp-remote-path' on hydra. (Bug#56424) * test/lisp/dnd-tests.el (dnd-tests-begin-drag-files): Remove instrumentation. * test/lisp/filenotify-tests.el: * test/lisp/shadowfile-tests.el: * test/lisp/net/tramp-tests.el: Do not adapt `tramp-remote-path'.
-rw-r--r--lisp/emacs-lisp/ert-x.el8
-rw-r--r--test/lisp/dnd-tests.el6
-rw-r--r--test/lisp/filenotify-tests.el4
-rw-r--r--test/lisp/net/tramp-tests.el11
-rw-r--r--test/lisp/shadowfile-tests.el4
5 files changed, 12 insertions, 21 deletions
diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el
index ae72a47c2fc..21a967cb4c9 100644
--- a/lisp/emacs-lisp/ert-x.el
+++ b/lisp/emacs-lisp/ert-x.el
@@ -488,9 +488,13 @@ The same keyword arguments are supported as in
488 (string-match "Apple \\(LLVM\\|[Cc]lang\\)\\|Xcode\\.app" 488 (string-match "Apple \\(LLVM\\|[Cc]lang\\)\\|Xcode\\.app"
489 (shell-command-to-string "gcc --version"))) 489 (shell-command-to-string "gcc --version")))
490 490
491
492(defvar tramp-methods)
493(defvar tramp-default-host-alist) 491(defvar tramp-default-host-alist)
492(defvar tramp-methods)
493(defvar tramp-remote-path)
494
495;; This should happen on hydra only.
496(when (getenv "EMACS_HYDRA_CI")
497 (add-to-list 'tramp-remote-path 'tramp-own-remote-path))
494 498
495;; If this defconst is used in a test file, `tramp' shall be loaded 499;; If this defconst is used in a test file, `tramp' shall be loaded
496;; prior `ert-x'. There is no default value on w32 systems, which 500;; prior `ert-x'. There is no default value on w32 systems, which
diff --git a/test/lisp/dnd-tests.el b/test/lisp/dnd-tests.el
index 7ce3677eaa0..88f6e694577 100644
--- a/test/lisp/dnd-tests.el
+++ b/test/lisp/dnd-tests.el
@@ -274,7 +274,6 @@ This function only tries to handle strings."
274 (skip-unless (and (dnd-tests-remote-accessible-p) 274 (skip-unless (and (dnd-tests-remote-accessible-p)
275 ;; TODO: make these tests work under X. 275 ;; TODO: make these tests work under X.
276 (not (eq window-system 'x)))) 276 (not (eq window-system 'x))))
277 (let ((tramp-verbose (if (getenv "EMACS_HYDRA_CI") 10 3)))
278 (let ((normal-temp-file (expand-file-name (make-temp-name "dnd-test") 277 (let ((normal-temp-file (expand-file-name (make-temp-name "dnd-test")
279 temporary-file-directory)) 278 temporary-file-directory))
280 (normal-temp-file-1 (expand-file-name (make-temp-name "dnd-test") 279 (normal-temp-file-1 (expand-file-name (make-temp-name "dnd-test")
@@ -384,14 +383,9 @@ This function only tries to handle strings."
384 ;; And when all remote files are inaccessible. 383 ;; And when all remote files are inaccessible.
385 (should-error (dnd-begin-drag-files (list nonexistent-remote-file 384 (should-error (dnd-begin-drag-files (list nonexistent-remote-file
386 nonexistent-remote-file-1)))) 385 nonexistent-remote-file-1))))
387 (when (getenv "EMACS_HYDRA_CI")
388 (dolist (buf (tramp-list-tramp-buffers))
389 (message ";; %s\n%s" buf (tramp-get-buffer-string buf))
390 (kill-buffer buf)))
391 (delete-file normal-temp-file) 386 (delete-file normal-temp-file)
392 (delete-file normal-temp-file-1) 387 (delete-file normal-temp-file-1)
393 (delete-file remote-temp-file)))) 388 (delete-file remote-temp-file))))
394 )
395 389
396(ert-deftest dnd-tests-get-local-file-uri () 390(ert-deftest dnd-tests-get-local-file-uri ()
397 (should (equal (dnd-get-local-file-uri "file://localhost/path/to/foo") 391 (should (equal (dnd-get-local-file-uri "file://localhost/path/to/foo")
diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el
index ad0138b2e7b..4ed1786a8ef 100644
--- a/test/lisp/filenotify-tests.el
+++ b/test/lisp/filenotify-tests.el
@@ -178,10 +178,6 @@ Return nil when any other file notification watch is still active."
178 tramp-allow-unsafe-temporary-files 178 tramp-allow-unsafe-temporary-files
179 (or tramp-allow-unsafe-temporary-files noninteractive)) 179 (or tramp-allow-unsafe-temporary-files noninteractive))
180 180
181;; This should happen on hydra only.
182(when (getenv "EMACS_HYDRA_CI")
183 (add-to-list 'tramp-remote-path 'tramp-own-remote-path))
184
185(defun file-notify--test-add-watch (file flags callback) 181(defun file-notify--test-add-watch (file flags callback)
186 "Like `file-notify-add-watch', but also passing FILE to CALLBACK." 182 "Like `file-notify-add-watch', but also passing FILE to CALLBACK."
187 (file-notify-add-watch file flags 183 (file-notify-add-watch file flags
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index a53fc7ec7ac..8b6d10033f1 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -128,6 +128,7 @@ A resource file is in the resource directory as per
128 `(expand-file-name ,file (ert-resource-directory))))) 128 `(expand-file-name ,file (ert-resource-directory)))))
129 129
130;; `ert-remote-temporary-file-directory' was introduced in Emacs 29.1. 130;; `ert-remote-temporary-file-directory' was introduced in Emacs 29.1.
131;; Adapting `tramp-remote-path' happens also there.
131(unless (boundp 'ert-remote-temporary-file-directory) 132(unless (boundp 'ert-remote-temporary-file-directory)
132 (eval-and-compile 133 (eval-and-compile
133 ;; There is no default value on w32 systems, which could work out 134 ;; There is no default value on w32 systems, which could work out
@@ -152,7 +153,11 @@ A resource file is in the resource directory as per
152 (unless (and (null noninteractive) (file-directory-p "~/")) 153 (unless (and (null noninteractive) (file-directory-p "~/"))
153 (setenv "HOME" temporary-file-directory)) 154 (setenv "HOME" temporary-file-directory))
154 (format "/mock::%s" temporary-file-directory))) 155 (format "/mock::%s" temporary-file-directory)))
155 "Temporary directory for remote file tests."))) 156 "Temporary directory for remote file tests.")
157
158 ;; This should happen on hydra only.
159 (when (getenv "EMACS_HYDRA_CI")
160 (add-to-list 'tramp-remote-path 'tramp-own-remote-path))))
156 161
157;; Beautify batch mode. 162;; Beautify batch mode.
158(when noninteractive 163(when noninteractive
@@ -178,10 +183,6 @@ A resource file is in the resource directory as per
178 tramp-persistency-file-name nil 183 tramp-persistency-file-name nil
179 tramp-verbose 0) 184 tramp-verbose 0)
180 185
181;; This should happen on hydra only.
182(when (getenv "EMACS_HYDRA_CI")
183 (add-to-list 'tramp-remote-path 'tramp-own-remote-path))
184
185(defvar tramp--test-enabled-checked nil 186(defvar tramp--test-enabled-checked nil
186 "Cached result of `tramp--test-enabled'. 187 "Cached result of `tramp--test-enabled'.
187If the function did run, the value is a cons cell, the `cdr' 188If the function did run, the value is a cons cell, the `cdr'
diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el
index e822bc9eb66..0916f7ce688 100644
--- a/test/lisp/shadowfile-tests.el
+++ b/test/lisp/shadowfile-tests.el
@@ -55,10 +55,6 @@
55 ert-remote-temporary-file-directory 55 ert-remote-temporary-file-directory
56 (ignore-errors (file-truename ert-remote-temporary-file-directory))) 56 (ignore-errors (file-truename ert-remote-temporary-file-directory)))
57 57
58;; This should happen on hydra only.
59(when (getenv "EMACS_HYDRA_CI")
60 (add-to-list 'tramp-remote-path 'tramp-own-remote-path))
61
62(defconst shadow-test-info-file 58(defconst shadow-test-info-file
63 (expand-file-name "shadows_test" temporary-file-directory) 59 (expand-file-name "shadows_test" temporary-file-directory)
64 "File to keep shadow information in during tests.") 60 "File to keep shadow information in during tests.")