tests: better per-test timeouts (#7612)
* tests: better per-test timeouts Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add 120s timeout to all integration test cases Signed-off-by: Jens Langhammer <jens@goauthentik.io> * used fixed (broken?) random seed Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
from shutil import rmtree
|
||||
from tempfile import mkdtemp
|
||||
|
||||
import pytest
|
||||
import yaml
|
||||
from channels.testing import ChannelsLiveServerTestCase
|
||||
from docker import DockerClient, from_env
|
||||
@ -95,12 +96,14 @@ class OutpostDockerTests(DockerTestCase, ChannelsLiveServerTestCase):
|
||||
except PermissionError:
|
||||
pass
|
||||
|
||||
@pytest.mark.timeout(120)
|
||||
def test_docker_controller(self):
|
||||
"""test that deployment requires update"""
|
||||
controller = DockerController(self.outpost, self.service_connection)
|
||||
controller.up()
|
||||
controller.down()
|
||||
|
||||
@pytest.mark.timeout(120)
|
||||
def test_docker_static(self):
|
||||
"""test that deployment requires update"""
|
||||
controller = DockerController(self.outpost, self.service_connection)
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
"""outpost tests"""
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
from django.test import TestCase
|
||||
from kubernetes.client import AppsV1Api
|
||||
from kubernetes.client.exceptions import OpenApiException
|
||||
@ -50,6 +51,7 @@ class OutpostKubernetesTests(TestCase):
|
||||
self.outpost.providers.add(self.provider)
|
||||
self.outpost.save()
|
||||
|
||||
@pytest.mark.timeout(120)
|
||||
def test_deployment_reconciler(self):
|
||||
"""test that deployment requires update"""
|
||||
controller = ProxyKubernetesController(self.outpost, self.service_connection)
|
||||
@ -88,6 +90,7 @@ class OutpostKubernetesTests(TestCase):
|
||||
|
||||
deployment_reconciler.delete(deployment_reconciler.get_reference_object())
|
||||
|
||||
@pytest.mark.timeout(120)
|
||||
def test_controller_rename(self):
|
||||
"""test that objects get deleted and re-created with new names"""
|
||||
controller = ProxyKubernetesController(self.outpost, self.service_connection)
|
||||
@ -100,6 +103,7 @@ class OutpostKubernetesTests(TestCase):
|
||||
apps.read_namespaced_deployment("test", self.outpost.config.kubernetes_namespace)
|
||||
controller.down()
|
||||
|
||||
@pytest.mark.timeout(120)
|
||||
def test_controller_full_update(self):
|
||||
"""Test an update that triggers all objects"""
|
||||
controller = ProxyKubernetesController(self.outpost, self.service_connection)
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
from shutil import rmtree
|
||||
from tempfile import mkdtemp
|
||||
|
||||
import pytest
|
||||
import yaml
|
||||
from channels.testing.live import ChannelsLiveServerTestCase
|
||||
from docker import DockerClient, from_env
|
||||
@ -95,12 +96,14 @@ class TestProxyDocker(DockerTestCase, ChannelsLiveServerTestCase):
|
||||
except PermissionError:
|
||||
pass
|
||||
|
||||
@pytest.mark.timeout(120)
|
||||
def test_docker_controller(self):
|
||||
"""test that deployment requires update"""
|
||||
controller = DockerController(self.outpost, self.service_connection)
|
||||
controller.up()
|
||||
controller.down()
|
||||
|
||||
@pytest.mark.timeout(120)
|
||||
def test_docker_static(self):
|
||||
"""test that deployment requires update"""
|
||||
controller = DockerController(self.outpost, self.service_connection)
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
"""Test Controllers"""
|
||||
from typing import Optional
|
||||
|
||||
import pytest
|
||||
import yaml
|
||||
from django.test import TestCase
|
||||
from structlog.stdlib import get_logger
|
||||
@ -32,6 +33,7 @@ class TestProxyKubernetes(TestCase):
|
||||
LOGGER.info(log)
|
||||
return super().tearDown()
|
||||
|
||||
@pytest.mark.timeout(120)
|
||||
def test_kubernetes_controller_static(self):
|
||||
"""Test Kubernetes Controller"""
|
||||
provider: ProxyProvider = ProxyProvider.objects.create(
|
||||
@ -53,6 +55,7 @@ class TestProxyKubernetes(TestCase):
|
||||
manifest = self.controller.get_static_deployment()
|
||||
self.assertEqual(len(list(yaml.load_all(manifest, Loader=yaml.SafeLoader))), 4)
|
||||
|
||||
@pytest.mark.timeout(120)
|
||||
def test_kubernetes_controller_ingress(self):
|
||||
"""Test Kubernetes Controller's Ingress"""
|
||||
provider: ProxyProvider = ProxyProvider.objects.create(
|
||||
|
||||
Reference in New Issue
Block a user