summarylogtreecommitdiffstats
path: root/tests_use_random_ports.patch
diff options
context:
space:
mode:
authorBlair Bonnett2021-12-05 17:01:18 +0100
committerBlair Bonnett2021-12-05 17:01:18 +0100
commite9e9c5b419334d4f343ff939a08c0a59b0bf7a8b (patch)
tree365d704981b61b9a7cfdbfe03f2d11a8fc6d1d22 /tests_use_random_ports.patch
parentefdc65659a1a725ed90e08c1485c2ec9bd1f3367 (diff)
downloadaur-e9e9c5b419334d4f343ff939a08c0a59b0bf7a8b.tar.gz
Update to 2.0.0
This includes a patch to make most of the tests use random ports so they can be run on a machine with an existing JupyterHub instance. A few tests which are incompatible with this are disabled.
Diffstat (limited to 'tests_use_random_ports.patch')
-rw-r--r--tests_use_random_ports.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests_use_random_ports.patch b/tests_use_random_ports.patch
new file mode 100644
index 000000000000..9c3c0aeff6f7
--- /dev/null
+++ b/tests_use_random_ports.patch
@@ -0,0 +1,34 @@
+--- jupyterhub/tests/mocking.py
++++ jupyterhub/tests/mocking.py
+
+@@ -245,6 +245,8 @@
+ if 'internal_certs_location' in kwargs:
+ cert_location = kwargs['internal_certs_location']
+ kwargs['external_certs'] = ssl_setup(cert_location, 'hub-ca')
++ self.config.JupyterHub.hub_port = random_port()
++ self.config.ConfigurableHTTPProxy.api_url = f'http://127.0.0.1:{random_port()}'
+ super().__init__(*args, **kwargs)
+
+ @default('subdomain_host')
+
+--- jupyterhub/tests/test_proxy.py
++++ jupyterhub/tests/test_proxy.py
+
+@@ -12,4 +12,5 @@
+ from ..utils import url_path_join as ujoin
+ from ..utils import wait_for_http_server
++from ..utils import random_port
+ from .mocking import MockHub
+ from .test_api import add_user
+@@ -32,9 +33,10 @@
+ auth_token = 'secret!'
+ proxy_ip = '127.0.0.1'
+- proxy_port = 54321
++ proxy_port = random_port()
+ cfg = Config()
+ cfg.ConfigurableHTTPProxy.auth_token = auth_token
+ cfg.ConfigurableHTTPProxy.api_url = 'http://%s:%i' % (proxy_ip, proxy_port)
+ cfg.ConfigurableHTTPProxy.should_start = False
++ cfg.JupyterHub.hub_port = random_port()
+
+ app = MockHub.instance(config=cfg)