travis buttressing

This commit is contained in:
dickmao 2019-02-19 15:29:18 -05:00
parent ed6482096e
commit 2f19904fe7
3 changed files with 30 additions and 30 deletions

View file

@ -119,9 +119,9 @@
(When "^new \\(.+\\) notebook$" (When "^new \\(.+\\) notebook$"
(lambda (kernel) (lambda (kernel)
(multiple-value-bind (url-or-port token) (ein:jupyter-server-conn-info) (multiple-value-bind (url-or-port token) (ein:jupyter-server-conn-info)
(lexical-let (notebook) (let (notebook)
(with-current-buffer (ein:notebooklist-get-buffer url-or-port) (with-current-buffer (ein:notebooklist-get-buffer url-or-port)
(lexical-let ((ks (ein:get-kernelspec url-or-port kernel))) (let ((ks (ein:get-kernelspec url-or-port kernel)))
(setq notebook (ein:testing-new-notebook url-or-port ks)))) (setq notebook (ein:testing-new-notebook url-or-port ks))))
(let ((buf-name (format ein:notebook-buffer-name-template (let ((buf-name (format ein:notebook-buffer-name-template
(ein:$notebook-url-or-port notebook) (ein:$notebook-url-or-port notebook)

View file

@ -368,7 +368,7 @@ This function is called via `ein:notebook-after-rename-hook'."
(ein:content-upload nb-path upload-path))) (ein:content-upload nb-path upload-path)))
;;;###autoload ;;;###autoload
(defun ein:notebooklist-new-notebook (url-or-port kernelspec &optional callback no-pop) (defun ein:notebooklist-new-notebook (url-or-port kernelspec &optional callback no-pop retry)
(interactive (list (ein:notebooklist-ask-url-or-port) (interactive (list (ein:notebooklist-ask-url-or-port)
(ido-completing-read (ido-completing-read
"Select kernel: " "Select kernel: "
@ -386,18 +386,18 @@ This function is called via `ein:notebook-after-rename-hook'."
:data (json-encode '((:type . "notebook"))) :data (json-encode '((:type . "notebook")))
:parser #'ein:json-read :parser #'ein:json-read
:error (apply-partially #'ein:notebooklist-new-notebook-error :error (apply-partially #'ein:notebooklist-new-notebook-error
url-or-port path callback) url-or-port kernelspec path callback no-pop retry)
:success (apply-partially #'ein:notebooklist-new-notebook-callback :success (apply-partially #'ein:notebooklist-new-notebook-success
url-or-port kernelspec path callback no-pop)))) url-or-port kernelspec path callback no-pop))))
(defun* ein:notebooklist-new-notebook-callback (url-or-port (defun* ein:notebooklist-new-notebook-success (url-or-port
kernelspec kernelspec
path path
callback callback
no-pop no-pop
&key &key
data data
&allow-other-keys) &allow-other-keys)
(let ((nbname (plist-get data :name)) (let ((nbname (plist-get data :name))
(nbpath (plist-get data :path))) (nbpath (plist-get data :path)))
(when (< (ein:notebook-version-numeric url-or-port) 3) (when (< (ein:notebook-version-numeric url-or-port) 3)
@ -408,19 +408,15 @@ This function is called via `ein:notebook-after-rename-hook'."
(ein:notebooklist-open* url-or-port path))) (ein:notebooklist-open* url-or-port path)))
(defun* ein:notebooklist-new-notebook-error (defun* ein:notebooklist-new-notebook-error
(url-or-port callback (url-or-port kernelspec path callback no-pop retry
&key response &allow-other-keys &key symbol-status error-thrown &allow-other-keys)
&aux (let ((notice (format "ein:notebooklist-new-notebook-error: %s %s"
(error (request-response-error-thrown response)) symbol-status error-thrown)))
(dest (request-response-url response))) (if retry
(ein:log 'verbose (ein:log 'error notice)
"NOTEBOOKLIST-NEW-NOTEBOOK-ERROR url-or-port: %S; error: %S; dest: %S" (ein:log 'info notice)
url-or-port error dest) (sleep-for 0 1500)
(ein:log 'error (ein:notebooklist-new-notebook url-or-port kernelspec callback no-pop t))))
"Failed to open new notebook (error: %S). \
You may find the new one in the notebook list." error)
(ein:notebooklist-open* url-or-port nil nil (lambda (buffer url-or-port)
(pop-to-buffer buffer))))
;;;###autoload ;;;###autoload
(defun ein:notebooklist-new-notebook-with-name (defun ein:notebooklist-new-notebook-with-name

View file

@ -93,7 +93,7 @@ if I call this between links in a deferred chain. Adding a flush-queue."
continue) continue)
(error "Timeout: %s" predicate)))) (error "Timeout: %s" predicate))))
(defun ein:testing-new-notebook (url-or-port ks) (defun ein:testing-new-notebook (url-or-port ks &optional retry)
(lexical-let (notebook) (lexical-let (notebook)
(condition-case err (condition-case err
(progn (progn
@ -109,9 +109,13 @@ if I call this between links in a deferred chain. Adding a flush-queue."
(ein:kernel-live-p it)))) (ein:kernel-live-p it))))
nil 10000 1000) nil 10000 1000)
notebook) notebook)
(error (ein:log 'error "ein:testing-new-notebook: [%s] %s" (error (let ((notice (format "ein:testing-new-notebook: [%s] %s"
url-or-port (error-message-string err)) url-or-port (error-message-string err))))
nil)))) (if retry
(progn (ein:log 'error notice) nil)
(ein:log 'info notice)
(sleep-for 0 1500)
(ein:testing-new-notebook url-or-port ks t)))))))
(defadvice ert-run-tests-batch (after ein:testing-dump-logs-hook activate) (defadvice ert-run-tests-batch (after ein:testing-dump-logs-hook activate)
"Hook `ein:testing-dump-logs-hook' because `kill-emacs-hook' "Hook `ein:testing-dump-logs-hook' because `kill-emacs-hook'