Files
docker-stacks/tests/base-notebook/test_healthcheck.py
Ayaz Salikhov a905ff6f6d Check healthcheck in all jupyter applications (#1854)
* Check healthcheck in all jupyter applications

* Fix

* Remove JUPYTERHUB_API_TOKEN healthcheck test
2023-01-04 10:24:09 +04:00

34 lines
865 B
Python

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import logging
import time
from typing import Optional
import pytest # type: ignore
from tests.conftest import TrackedContainer, get_health
LOGGER = logging.getLogger(__name__)
@pytest.mark.parametrize(
"env",
[
None,
["DOCKER_STACKS_JUPYTER_CMD=lab"],
["RESTARTABLE=yes"],
["DOCKER_STACKS_JUPYTER_CMD=notebook"],
["DOCKER_STACKS_JUPYTER_CMD=server"],
["DOCKER_STACKS_JUPYTER_CMD=nbclassic"],
],
)
def test_health(container: TrackedContainer, env: Optional[list[str]]) -> None:
running_container = container.run_detached(
tty=True,
environment=env,
)
# sleeping some time to let the server start
time.sleep(15)
assert get_health(running_container) == "healthy"