diff options
| author | Michael Albinus | 2022-07-10 18:13:50 +0200 |
|---|---|---|
| committer | Michael Albinus | 2022-07-10 18:13:50 +0200 |
| commit | 4bab499ed0d40d4e5ca68e5a17bcf5341125f734 (patch) | |
| tree | 4b868953b350a84dba54a05cc3e36185a7223c40 /test | |
| parent | f8de0d5436adbfe3e83e358c08d4367c65951212 (diff) | |
| download | emacs-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'.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/dnd-tests.el | 6 | ||||
| -rw-r--r-- | test/lisp/filenotify-tests.el | 4 | ||||
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 11 | ||||
| -rw-r--r-- | test/lisp/shadowfile-tests.el | 4 |
4 files changed, 6 insertions, 19 deletions
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'. |
| 187 | If the function did run, the value is a cons cell, the `cdr' | 188 | If 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.") |