Further adaptions for shadowfile-tests.el

* test/lisp/shadowfile-tests.el: Change some traces.
(shadow-test-remote-temporary-file-directory): Adapt also remote
home directory.
(shadow--tests-cleanup): Cleanup Tramp.
This commit is contained in:
Michael Albinus 2019-10-03 10:44:02 +02:00
parent 1854511e97
commit b27c7f3e60

View file

@ -56,16 +56,17 @@
'tramp-default-host-alist
`("\\`mock\\'" nil ,(system-name)))
;; Emacs' Makefile sets $HOME to a nonexistent value. Needed in
;; batch mode only, therefore. It cannot be
;; batch mode only, therefore. `shadow-homedir' cannot be
;; `temporary-directory', because the tests with "~" would fail.
(unless (and (null noninteractive) (file-directory-p "~/"))
(setenv "HOME" invocation-directory))
(setenv "HOME" (file-name-unquote temporary-file-directory))
(setq shadow-homedir invocation-directory)
(add-to-list
'tramp-connection-properties
`(,(file-remote-p "/mock::%s") "~" ,invocation-directory)))
(format "/mock::%s" temporary-file-directory)))
"Temporary directory for Tramp tests.")
(message
"%s %s" temporary-file-directory shadow-test-remote-temporary-file-directory)
(setq password-cache-expiry nil
shadow-debug (getenv "EMACS_HYDRA_CI")
tramp-verbose 0
@ -76,11 +77,6 @@
(ignore-errors
(file-truename shadow-test-remote-temporary-file-directory)))
(when shadow-debug
(message
"%s %s"
temporary-file-directory shadow-test-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))
@ -95,6 +91,9 @@
(defun shadow--tests-cleanup ()
"Reset all `shadowfile' internals."
;; Cleanup Tramp.
(tramp-cleanup-connection
(tramp-dissect-file-name shadow-test-remote-temporary-file-directory) t t)
;; Delete auto-saved files.
(with-current-buffer (find-file-noselect shadow-info-file 'nowarn)
(ignore-errors (delete-file (make-auto-save-file-name)))
@ -740,6 +739,12 @@ guaranteed by the originator of a cluster definition."
;; Cleanup & initialize.
(shadow--tests-cleanup)
(shadow-initialize)
(when shadow-debug
(message
"%s %s %s %s %s"
temporary-file-directory
shadow-test-remote-temporary-file-directory
shadow-homedir shadow-info-file shadow-todo-file))
;; Define clusters.
(setq cluster1 "cluster1"