Commit 3a28d64e authored by Glenn Morris's avatar Glenn Morris
Browse files

Do not hard-code port for package test server. (Bug#23708)

* test/lisp/emacs-lisp/package-resources/
Do not hard-code port.
* test/lisp/emacs-lisp/package-tests.el (package-test-update-archives-async):
Update for the above change.
parent f4ef1a1f
......@@ -10,7 +10,7 @@
if sys.argv[1:]:
port = int(sys.argv[1])
port = 8000
port = 0
server_address = ('', port)
HandlerClass.protocol_version = Protocol
......@@ -372,16 +372,28 @@ Must called from within a `tar-mode' buffer."
(skip-unless (executable-find "python2"))
;; For some reason this test doesn't work reliably on
(skip-unless (not (getenv "NIX_STORE")))
(with-package-test (:basedir
:location "")
(let* ((package-menu-async t)
(default-directory package-test-data-dir)
(process (start-process
"package-server" "package-server-buffer"
(executable-find "python2")
(expand-file-name ""))))
(with-current-buffer "package-server-buffer"
(with-timeout (10 nil)
(while (not port)
(accept-process-output nil 1)
(goto-char (point-min))
(if (re-search-forward "Serving HTTP on .* port \\([0-9]+\\) "
nil t)
(setq port (match-string 1))))
(with-package-test (:basedir
:location (format "" port))
(should package--downloads-in-progress)
(should mode-line-process)
......@@ -395,8 +407,8 @@ Must called from within a `tar-mode' buffer."
(skip-unless (process-live-p process))
(goto-char (point-min))
(search-forward-regexp "^ +simple-single" nil t)))
(if (process-live-p process) (kill-process process))))))
(search-forward-regexp "^ +simple-single" nil t))))
(if (process-live-p process) (kill-process process)))))
(ert-deftest package-test-describe-package ()
"Test displaying help for a package."
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment