mirror of
https://github.com/goauthentik/authentik
synced 2026-04-25 17:15:26 +02:00
* initial Signed-off-by: Jens Langhammer <jens@goauthentik.io> * use same startup template Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix check not working Signed-off-by: Jens Langhammer <jens@goauthentik.io> * unrelated: fix inspector auth Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add tests Signed-off-by: Jens Langhammer <jens@goauthentik.io> * update docs Signed-off-by: Jens Langhammer <jens@goauthentik.io> * ensure oobe flow can only accessed via correct url Signed-off-by: Jens Langhammer <jens@goauthentik.io> * set setup flag when applying bootstrap blueprint when env is set Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add system visibility to flags to make them non-editable Signed-off-by: Jens Langhammer <jens@goauthentik.io> * set setup flag for e2e tests Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix tests and linting Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix tests Signed-off-by: Jens Langhammer <jens@goauthentik.io> * make github lint happy Signed-off-by: Jens Langhammer <jens@goauthentik.io> * make tests have less assumptions Signed-off-by: Jens Langhammer <jens@goauthentik.io> * Update docs * include more heuristics in migration Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add management command to set any flag Signed-off-by: Jens Langhammer <jens@goauthentik.io> * migrate worker command to signal Signed-off-by: Jens Langhammer <jens@goauthentik.io> * improved api for setting flags Signed-off-by: Jens Langhammer <jens@goauthentik.io> * short circuit Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: Dewi Roberts <dewi@goauthentik.io>
57 lines
1.6 KiB
Python
57 lines
1.6 KiB
Python
from sys import stderr
|
|
|
|
from channels.testing import ChannelsLiveServerTestCase
|
|
from django.apps import apps
|
|
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
|
|
from dramatiq import get_broker
|
|
from structlog.stdlib import get_logger
|
|
|
|
from authentik.core.apps import Setup
|
|
from authentik.core.models import User
|
|
from authentik.core.tests.utils import create_test_admin_user
|
|
from authentik.tasks.test import use_test_broker
|
|
from tests._process import TestDatabaseProcess
|
|
from tests.decorators import IS_CI, get_local_ip
|
|
from tests.docker import DockerTestCase
|
|
|
|
|
|
class E2ETestMixin(DockerTestCase):
|
|
host = get_local_ip()
|
|
user: User
|
|
serve_static = True
|
|
ProtocolServerProcess = TestDatabaseProcess
|
|
|
|
def setUp(self):
|
|
if IS_CI:
|
|
print("::group::authentik Logs", file=stderr)
|
|
apps.get_app_config("authentik_tenants").ready()
|
|
self.wait_timeout = 60
|
|
self.logger = get_logger()
|
|
self.user = create_test_admin_user()
|
|
Setup.set(True)
|
|
super().setUp()
|
|
|
|
@classmethod
|
|
def _pre_setup(cls):
|
|
use_test_broker()
|
|
return super()._pre_setup()
|
|
|
|
def _post_teardown(self):
|
|
broker = get_broker()
|
|
broker.flush_all()
|
|
broker.close()
|
|
return super()._post_teardown()
|
|
|
|
def tearDown(self):
|
|
if IS_CI:
|
|
print("::endgroup::", file=stderr)
|
|
super().tearDown()
|
|
|
|
|
|
class E2ETestCase(E2ETestMixin, StaticLiveServerTestCase):
|
|
"""E2E Test case with django static live server"""
|
|
|
|
|
|
class ChannelsE2ETestCase(E2ETestMixin, ChannelsLiveServerTestCase):
|
|
"""E2E Test case with channels live server (websocket + static)"""
|