1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-29 07:58:28 +00:00

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'.
This commit is contained in:
Michael Albinus 2022-07-10 18:13:50 +02:00
parent f8de0d5436
commit 4bab499ed0
5 changed files with 12 additions and 21 deletions

View File

@ -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

View File

@ -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")

View File

@ -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

View File

@ -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'

View File

@ -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.")