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 (string-match "Apple \\(LLVM\\|[Cc]lang\\)\\|Xcode\\.app" (shell-command-to-string "gcc --version"))) - -(defvar tramp-methods) (defvar tramp-default-host-alist) +(defvar tramp-methods) +(defvar tramp-remote-path) + +;; This should happen on hydra only. +(when (getenv "EMACS_HYDRA_CI") + (add-to-list 'tramp-remote-path 'tramp-own-remote-path)) ;; If this defconst is used in a test file, `tramp' shall be loaded ;; 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." (skip-unless (and (dnd-tests-remote-accessible-p) ;; TODO: make these tests work under X. (not (eq window-system 'x)))) - (let ((tramp-verbose (if (getenv "EMACS_HYDRA_CI") 10 3))) (let ((normal-temp-file (expand-file-name (make-temp-name "dnd-test") temporary-file-directory)) (normal-temp-file-1 (expand-file-name (make-temp-name "dnd-test") @@ -384,14 +383,9 @@ This function only tries to handle strings." ;; And when all remote files are inaccessible. (should-error (dnd-begin-drag-files (list nonexistent-remote-file nonexistent-remote-file-1)))) - (when (getenv "EMACS_HYDRA_CI") - (dolist (buf (tramp-list-tramp-buffers)) - (message ";; %s\n%s" buf (tramp-get-buffer-string buf)) - (kill-buffer buf))) (delete-file normal-temp-file) (delete-file normal-temp-file-1) (delete-file remote-temp-file)))) - ) (ert-deftest dnd-tests-get-local-file-uri () (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." tramp-allow-unsafe-temporary-files (or tramp-allow-unsafe-temporary-files noninteractive)) -;; This should happen on hydra only. -(when (getenv "EMACS_HYDRA_CI") - (add-to-list 'tramp-remote-path 'tramp-own-remote-path)) - (defun file-notify--test-add-watch (file flags callback) "Like `file-notify-add-watch', but also passing FILE to CALLBACK." (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 `(expand-file-name ,file (ert-resource-directory))))) ;; `ert-remote-temporary-file-directory' was introduced in Emacs 29.1. +;; Adapting `tramp-remote-path' happens also there. (unless (boundp 'ert-remote-temporary-file-directory) (eval-and-compile ;; 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 (unless (and (null noninteractive) (file-directory-p "~/")) (setenv "HOME" temporary-file-directory)) (format "/mock::%s" temporary-file-directory))) - "Temporary directory for remote file tests."))) + "Temporary directory for remote file tests.") + + ;; This should happen on hydra only. + (when (getenv "EMACS_HYDRA_CI") + (add-to-list 'tramp-remote-path 'tramp-own-remote-path)))) ;; Beautify batch mode. (when noninteractive @@ -178,10 +183,6 @@ A resource file is in the resource directory as per tramp-persistency-file-name nil tramp-verbose 0) -;; This should happen on hydra only. -(when (getenv "EMACS_HYDRA_CI") - (add-to-list 'tramp-remote-path 'tramp-own-remote-path)) - (defvar tramp--test-enabled-checked nil "Cached result of `tramp--test-enabled'. 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 @@ ert-remote-temporary-file-directory (ignore-errors (file-truename ert-remote-temporary-file-directory))) -;; This should happen on hydra only. -(when (getenv "EMACS_HYDRA_CI") - (add-to-list 'tramp-remote-path 'tramp-own-remote-path)) - (defconst shadow-test-info-file (expand-file-name "shadows_test" temporary-file-directory) "File to keep shadow information in during tests.")