mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-15 05:52:57 +00:00
Run tests in parallel
This commit is contained in:
@@ -7,7 +7,7 @@ import logging
|
||||
import pytest # type: ignore
|
||||
import requests
|
||||
|
||||
from conftest import TrackedContainer
|
||||
from conftest import TrackedContainer, find_free_port
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -15,11 +15,11 @@ LOGGER = logging.getLogger(__name__)
|
||||
def test_cli_args(container: TrackedContainer, http_client: requests.Session) -> None:
|
||||
"""Container should respect notebook server command line args
|
||||
(e.g., disabling token security)"""
|
||||
host_port = find_free_port()
|
||||
running_container = container.run_detached(
|
||||
command=["start-notebook.sh", "--NotebookApp.token=''"],
|
||||
ports={"8888/tcp": None},
|
||||
ports={"8888/tcp": host_port},
|
||||
)
|
||||
host_port = container.get_host_port("8888/tcp")
|
||||
resp = http_client.get(f"http://localhost:{host_port}")
|
||||
resp.raise_for_status()
|
||||
logs = running_container.logs().decode("utf-8")
|
||||
@@ -37,11 +37,11 @@ def test_unsigned_ssl(
|
||||
"""Container should generate a self-signed SSL certificate
|
||||
and notebook server should use it to enable HTTPS.
|
||||
"""
|
||||
host_port = find_free_port()
|
||||
running_container = container.run_detached(
|
||||
environment=["GEN_CERT=yes"],
|
||||
ports={"8888/tcp": None},
|
||||
ports={"8888/tcp": host_port},
|
||||
)
|
||||
host_port = container.get_host_port("8888/tcp")
|
||||
# NOTE: The requests.Session backing the http_client fixture does not retry
|
||||
# properly while the server is booting up. An SSL handshake error seems to
|
||||
# abort the retry logic. Forcing a long sleep for the moment until I have
|
||||
|
Reference in New Issue
Block a user