diff options
| author | Glenn Morris | 2016-06-07 21:25:20 -0400 |
|---|---|---|
| committer | Glenn Morris | 2016-06-07 21:25:20 -0400 |
| commit | 3a28d64e275ca6860f81016b04a2024d9c66da1f (patch) | |
| tree | b0d3282c3452e15c64c89d5479c83fa095645c50 | |
| parent | f4ef1a1fea15aa58fbb5e7a59bff260720658e49 (diff) | |
| download | emacs-3a28d64e275ca6860f81016b04a2024d9c66da1f.tar.gz emacs-3a28d64e275ca6860f81016b04a2024d9c66da1f.zip | |
Do not hard-code port for package test server. (Bug#23708)
* test/lisp/emacs-lisp/package-resources/package-test-server.py:
Do not hard-code port.
* test/lisp/emacs-lisp/package-tests.el (package-test-update-archives-async):
Update for the above change.
| -rw-r--r-- | test/lisp/emacs-lisp/package-resources/package-test-server.py | 2 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/package-tests.el | 36 |
2 files changed, 25 insertions, 13 deletions
diff --git a/test/lisp/emacs-lisp/package-resources/package-test-server.py b/test/lisp/emacs-lisp/package-resources/package-test-server.py index 35ca820f31f..1acd9f744b9 100644 --- a/test/lisp/emacs-lisp/package-resources/package-test-server.py +++ b/test/lisp/emacs-lisp/package-resources/package-test-server.py | |||
| @@ -10,7 +10,7 @@ Protocol = "HTTP/1.0" | |||
| 10 | if sys.argv[1:]: | 10 | if sys.argv[1:]: |
| 11 | port = int(sys.argv[1]) | 11 | port = int(sys.argv[1]) |
| 12 | else: | 12 | else: |
| 13 | port = 8000 | 13 | port = 0 |
| 14 | server_address = ('127.0.0.1', port) | 14 | server_address = ('127.0.0.1', port) |
| 15 | 15 | ||
| 16 | HandlerClass.protocol_version = Protocol | 16 | HandlerClass.protocol_version = Protocol |
diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el index c7a5cc7af22..0a446fde086 100644 --- a/test/lisp/emacs-lisp/package-tests.el +++ b/test/lisp/emacs-lisp/package-tests.el | |||
| @@ -372,16 +372,28 @@ Must called from within a `tar-mode' buffer." | |||
| 372 | (skip-unless (executable-find "python2")) | 372 | (skip-unless (executable-find "python2")) |
| 373 | ;; For some reason this test doesn't work reliably on hydra.nixos.org. | 373 | ;; For some reason this test doesn't work reliably on hydra.nixos.org. |
| 374 | (skip-unless (not (getenv "NIX_STORE"))) | 374 | (skip-unless (not (getenv "NIX_STORE"))) |
| 375 | (with-package-test (:basedir | 375 | (let* ((package-menu-async t) |
| 376 | package-test-data-dir | 376 | (default-directory package-test-data-dir) |
| 377 | :location "http://0.0.0.0:8000/") | 377 | (process (start-process |
| 378 | (let* ((package-menu-async t) | 378 | "package-server" "package-server-buffer" |
| 379 | (process (start-process | 379 | (executable-find "python2") |
| 380 | "package-server" "package-server-buffer" | 380 | "package-test-server.py")) |
| 381 | (executable-find "python2") | 381 | port) |
| 382 | (expand-file-name "package-test-server.py")))) | 382 | (unwind-protect |
| 383 | (unwind-protect | 383 | (progn |
| 384 | (progn | 384 | (with-current-buffer "package-server-buffer" |
| 385 | (should | ||
| 386 | (with-timeout (10 nil) | ||
| 387 | (while (not port) | ||
| 388 | (accept-process-output nil 1) | ||
| 389 | (goto-char (point-min)) | ||
| 390 | (if (re-search-forward "Serving HTTP on .* port \\([0-9]+\\) " | ||
| 391 | nil t) | ||
| 392 | (setq port (match-string 1)))) | ||
| 393 | port))) | ||
| 394 | (with-package-test (:basedir | ||
| 395 | package-test-data-dir | ||
| 396 | :location (format "http://0.0.0.0:%s/" port)) | ||
| 385 | (list-packages) | 397 | (list-packages) |
| 386 | (should package--downloads-in-progress) | 398 | (should package--downloads-in-progress) |
| 387 | (should mode-line-process) | 399 | (should mode-line-process) |
| @@ -395,8 +407,8 @@ Must called from within a `tar-mode' buffer." | |||
| 395 | (skip-unless (process-live-p process)) | 407 | (skip-unless (process-live-p process)) |
| 396 | (goto-char (point-min)) | 408 | (goto-char (point-min)) |
| 397 | (should | 409 | (should |
| 398 | (search-forward-regexp "^ +simple-single" nil t))) | 410 | (search-forward-regexp "^ +simple-single" nil t)))) |
| 399 | (if (process-live-p process) (kill-process process)))))) | 411 | (if (process-live-p process) (kill-process process))))) |
| 400 | 412 | ||
| 401 | (ert-deftest package-test-describe-package () | 413 | (ert-deftest package-test-describe-package () |
| 402 | "Test displaying help for a package." | 414 | "Test displaying help for a package." |