Instrument shadowfile{-tests} for error hunting on hydra.

* lisp/shadowfile.el (shadow-make-fullname): Use changed
`tramp-make-tramp-file-name' from Tramp 2.4.

* test/lisp/shadowfile-tests.el (shadow-test08-shadow-todo):
Instrument test.  Suppress errors in cleanup.
(shadow-test09-shadow-copy-files): Suppress errors in cleanup.
This commit is contained in:
Michael Albinus 2018-07-25 13:18:46 +02:00
parent 200195e824
commit c67407e752
2 changed files with 15 additions and 16 deletions

View file

@ -307,14 +307,7 @@ Replace HOST, and NAME when non-nil."
(if (null (tramp-file-name-method hup))
(format
"/%s:%s" (tramp-file-name-host hup) (tramp-file-name-localname hup))
(tramp-make-tramp-file-name
(tramp-file-name-method hup)
(tramp-file-name-user hup)
(tramp-file-name-domain hup)
(tramp-file-name-host hup)
(tramp-file-name-port hup)
(tramp-file-name-localname hup)
(tramp-file-name-hop hup)))))
(tramp-make-tramp-file-name hup))))
(defun shadow-replace-name-component (fullname newname)
"Return FULLNAME with the name component changed to NEWNAME."

View file

@ -696,6 +696,7 @@ guaranteed by the originator of a cluster definition."
shadow-files-to-copy
cluster1 cluster2 primary regexp file)
(unwind-protect
(condition-case err
(progn
;; Cleanup.
(when (file-exists-p shadow-info-file)
@ -773,16 +774,19 @@ guaranteed by the originator of a cluster definition."
(concat (shadow-site-primary cluster2) file)
(shadow-contract-file-name (concat "/cluster1:" file)))
shadow-files-to-copy)))
(error (message "Error: %s" err) (signal (car err) (cdr err))))
;; Cleanup.
(when (file-exists-p shadow-info-file)
(delete-file shadow-info-file))
(when (file-exists-p shadow-todo-file)
(delete-file shadow-todo-file))
(when (file-exists-p file)
(delete-file file))
(when (file-exists-p (concat (shadow-site-primary cluster2) file))
(delete-file (concat (shadow-site-primary cluster2) file))))))
(ignore-errors
(when (file-exists-p file)
(delete-file file)))
(ignore-errors
(when (file-exists-p (concat (shadow-site-primary cluster2) file))
(delete-file (concat (shadow-site-primary cluster2) file)))))))
(ert-deftest shadow-test09-shadow-copy-files ()
"Check that needed shadow files are copied."
@ -864,10 +868,12 @@ guaranteed by the originator of a cluster definition."
(delete-file shadow-info-file))
(when (file-exists-p shadow-todo-file)
(delete-file shadow-todo-file))
(when (file-exists-p file)
(delete-file file))
(when (file-exists-p (concat (shadow-site-primary cluster2) file))
(delete-file (concat (shadow-site-primary cluster2) file))))))
(ignore-errors
(when (file-exists-p file)
(delete-file file)))
(ignore-errors
(when (file-exists-p (concat (shadow-site-primary cluster2) file))
(delete-file (concat (shadow-site-primary cluster2) file)))))))
(defun shadowfile-test-all (&optional interactive)
"Run all tests for \\[shadowfile]."