[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ssh-deploy 7d578da 088/133: Passing unit test for async
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ssh-deploy 7d578da 088/133: Passing unit test for asynchronous change detection |
Date: |
Sat, 27 Mar 2021 14:48:49 -0400 (EDT) |
branch: externals/ssh-deploy
commit 7d578daa042055a7dba2947011d0918ae5544fcc
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Passing unit test for asynchronous change detection
---
ssh-deploy-test.el | 26 ++++++++++++++++----------
ssh-deploy.el | 13 ++++++++++---
2 files changed, 26 insertions(+), 13 deletions(-)
diff --git a/ssh-deploy-test.el b/ssh-deploy-test.el
index 61b8026..15f89d1 100644
--- a/ssh-deploy-test.el
+++ b/ssh-deploy-test.el
@@ -300,7 +300,7 @@
;; Update should not trigger upload
(find-file file-b)
- (insert "Random blbob")
+ (insert "Random blob")
(save-buffer)
(kill-buffer)
@@ -311,8 +311,13 @@
(if (> async 0)
(progn
(ssh-deploy--async-process
- (lambda() (ssh-deploy--remote-changes-data file-a))
- (lambda(response) (should (equal 5 (nth 0 response))))
+ `(lambda()
+ ;; (format "root local 2: %s, root remote: %s,
revision-folder: %s, exclude-list: %s" ,ssh-deploy-root-local
,ssh-deploy-root-remote ,ssh-deploy-revision-folder ,ssh-deploy-exclude-list)
+ (ssh-deploy--remote-changes-data ,file-a
,ssh-deploy-root-local ,ssh-deploy-root-remote ,ssh-deploy-revision-folder)
+ )
+ (lambda(response)
+ ;;(message "Response: %s" response)
+ (should (equal 5 (nth 0 response))))
async-with-threads)
(sleep-for 1))
(should (equal 5 (nth 0 (ssh-deploy--remote-changes-data file-a)))))
@@ -328,8 +333,9 @@
(if (> async 0)
(progn
(ssh-deploy--async-process
- (lambda() (ssh-deploy--remote-changes-data file-a))
- (lambda(response) (should (equal 4 (nth 0 response))))
+ `(lambda()
+ (ssh-deploy--remote-changes-data ,file-a
,ssh-deploy-root-local ,ssh-deploy-root-remote ,ssh-deploy-revision-folder))
+ (lambda(response)(should (equal 4 (nth 0 response))))
async-with-threads)
(sleep-for 1))
(should (equal 4 (nth 0 (ssh-deploy--remote-changes-data file-a)))))
@@ -377,11 +383,6 @@
(ssh-deploy-test--file-is-in-path)
(ssh-deploy-test--is-not-empty-string)
- (ssh-deploy-test--detect-remote-changes 0 0)
- (when async-el
- (ssh-deploy-test--detect-remote-changes 1 0))
- (ssh-deploy-test--detect-remote-changes 1 1)
-
(ssh-deploy-test--upload 0 0)
(when async-el
(ssh-deploy-test--upload 1 0))
@@ -397,6 +398,11 @@
(ssh-deploy-test--rename-and-delete 1 0))
(ssh-deploy-test--rename-and-delete 1 1)
+ (ssh-deploy-test--detect-remote-changes 0 0)
+ (when async-el
+ (ssh-deploy-test--detect-remote-changes 1 0))
+ (ssh-deploy-test--detect-remote-changes 1 1)
+
(delete-directory revision-folder t)
diff --git a/ssh-deploy.el b/ssh-deploy.el
index 91f74e8..281a707 100644
--- a/ssh-deploy.el
+++ b/ssh-deploy.el
@@ -306,7 +306,11 @@
(display-warning 'ssh-deploy "make-thread function are not
available!"))
(if (fboundp 'async-start)
(when start
- (let ((ftp-netrc nil))
+ (let ((ftp-netrc nil)
+ (root-local ssh-deploy-root-local)
+ (root-remote ssh-deploy-root-remote)
+ (revision-folder ssh-deploy-revision-folder)
+ (exclude-list ssh-deploy-exclude-list))
(when (boundp 'ange-ftp-netrc-filename)
(setq ftp-netrc ange-ftp-netrc-filename))
(let ((script-filename (file-name-directory (symbol-file
'ssh-deploy-diff-directories))))
@@ -316,11 +320,14 @@
(ssh-deploy-async-with-threads 0)
(ssh-deploy-on-explicit-save 0)
(ssh-deploy-automatically-detect-remote-changes 0)
- (ssh-deploy-revision-folder ssh-deploy-revision-folder)
- (ssh-deploy-exclude-list ssh-deploy-exclude-list))
+ (ssh-deploy-root-local root-local)
+ (ssh-deploy-root-remote root-remote)
+ (ssh-deploy-revision-folder revision-folder)
+ (ssh-deploy-exclude-list exclude-list))
(when ftp-netrc
;; Pass ange-ftp setting to asynchronous process
(defvar ange-ftp-netrc-filename ftp-netrc))
+
(add-to-list 'load-path script-filename)
(autoload 'ediff-same-file-contents "ediff-util")
(autoload 'string-remove-prefix "subr-x")
- [elpa] externals/ssh-deploy 88300e3 043/133: Improved wording of remote change detection, (continued)
- [elpa] externals/ssh-deploy 88300e3 043/133: Improved wording of remote change detection, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy e08b8bb 044/133: Improved documentation, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy b480db9 055/133: Changed (when (not)) to (unless), Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 31cb94d 060/133: Added compile command to makefile and added a .gitignore file, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy d03bd70 068/133: Added unit-test for uploads, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 95e823a 074/133: Fixed issue with byte-compilation warning in new unit tests, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy f233e2e 075/133: Removed checks for ediff-same-file-contents function since it's built-in in Emacs, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 336833f 076/133: Got (autoload) working inside asynchronous process, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy db73e5b 083/133: Started in new function for detecting remote changes that should be testable by unit tests, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 3a6c3ac 084/133: More work on making detect remote changes unit-testable, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 7d578da 088/133: Passing unit test for asynchronous change detection,
Stefan Monnier <=
- [elpa] externals/ssh-deploy 20a87ab 099/133: Added async.el to travis test, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 761eb11 098/133: Updated Travis to use emacs version snapshot, 25.1 and 26.1 via EVM, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 0111640 108/133: Removed unnecessary async autoloads, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy ea734f5 104/133: Added note, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 49ae447 097/133: Fixed Travis build status logo, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy a5aa5f6 093/133: Run only async test with threads if threads are available, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy b8f976a 116/133: Passing verbose flag to diff files function, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy e1507fe 119/133: Create FUNDING.yml, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy 37a15c6 118/133: fix: ".git" matching, Stefan Monnier, 2021/03/27
- [elpa] externals/ssh-deploy d0f7294 121/133: When remote differs only with local-revision, update local-revision [#61], Stefan Monnier, 2021/03/27