diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 671bf5d6..2255fc78 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -77,6 +77,10 @@ jobs: # Tests everything when the user instances are started with # jupyter_server instead of notebook. # + # ssl: + # Tests everything using internal SSL connections instead of + # unencrypted HTTP + # # main_dependencies: # Tests everything when the we use the latest available dependencies # from: ipytraitlets. @@ -91,6 +95,7 @@ jobs: db: mysql - python: "3.8" db: postgres + ssl: enabled - python: "3.8" jupyter_server: jupyter_server - python: "3.9" @@ -109,6 +114,9 @@ jobs: echo "MYSQL_HOST=127.0.0.1" >> $GITHUB_ENV echo "JUPYTERHUB_TEST_DB_URL=mysql+mysqlconnector://root@127.0.0.1:3306/jupyterhub" >> $GITHUB_ENV fi + if [ "${{ matrix.ssl }}" == "enabled" ]; then + echo "SSL_ENABLED=1" >> $GITHUB_ENV + fi if [ "${{ matrix.db }}" == "postgres" ]; then echo "PGHOST=127.0.0.1" >> $GITHUB_ENV echo "PGUSER=test_user" >> $GITHUB_ENV diff --git a/jupyterhub/tests/conftest.py b/jupyterhub/tests/conftest.py index 7126baa7..000de730 100644 --- a/jupyterhub/tests/conftest.py +++ b/jupyterhub/tests/conftest.py @@ -74,7 +74,11 @@ def ssl_tmpdir(tmpdir_factory): def app(request, io_loop, ssl_tmpdir): """Mock a jupyterhub app for testing""" mocked_app = None - ssl_enabled = getattr(request.module, "ssl_enabled", False) + if 'SSL_ENABLED' in os.environ: + ssl_env_var = bool(os.environ['SSL_ENABLED']) + else: + ssl_env_var = False + ssl_enabled = getattr(request.module, "ssl_enabled", ssl_env_var) kwargs = dict() if ssl_enabled: kwargs.update(dict(internal_ssl=True, internal_certs_location=str(ssl_tmpdir))) diff --git a/jupyterhub/tests/test_internal_ssl_api.py b/jupyterhub/tests/test_internal_ssl_api.py deleted file mode 100644 index 17349ae6..00000000 --- a/jupyterhub/tests/test_internal_ssl_api.py +++ /dev/null @@ -1,6 +0,0 @@ -"""Tests for the SSL enabled REST API.""" -# Copyright (c) Jupyter Development Team. -# Distributed under the terms of the Modified BSD License. -from jupyterhub.tests.test_api import * - -ssl_enabled = True diff --git a/jupyterhub/tests/test_internal_ssl_app.py b/jupyterhub/tests/test_internal_ssl_app.py deleted file mode 100644 index cae0519b..00000000 --- a/jupyterhub/tests/test_internal_ssl_app.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Test the JupyterHub entry point with internal ssl""" -# Copyright (c) Jupyter Development Team. -# Distributed under the terms of the Modified BSD License. -import jupyterhub.tests.mocking -from jupyterhub.tests.test_app import * - -ssl_enabled = True diff --git a/jupyterhub/tests/test_internal_ssl_spawner.py b/jupyterhub/tests/test_internal_ssl_spawner.py deleted file mode 100644 index 85ea5ccd..00000000 --- a/jupyterhub/tests/test_internal_ssl_spawner.py +++ /dev/null @@ -1,6 +0,0 @@ -"""Tests for process spawning with internal_ssl""" -# Copyright (c) Jupyter Development Team. -# Distributed under the terms of the Modified BSD License. -from jupyterhub.tests.test_spawner import * - -ssl_enabled = True