tests/e2e: remove logger
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
91fd792f88
commit
b2d2e7cbc8
|
@ -22,7 +22,7 @@ def create_test_flow(designation: FlowDesignation = FlowDesignation.STAGE_CONFIG
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def create_test_admin_user(name: Optional[str] = None, set_password = False) -> User:
|
def create_test_admin_user(name: Optional[str] = None, set_password=False) -> User:
|
||||||
"""Generate a test-admin user"""
|
"""Generate a test-admin user"""
|
||||||
uid = generate_id(20) if not name else name
|
uid = generate_id(20) if not name else name
|
||||||
group = Group.objects.create(name=uid, is_superuser=True)
|
group = Group.objects.create(name=uid, is_superuser=True)
|
||||||
|
|
|
@ -40,5 +40,8 @@ class PytestTestRunner: # pragma: no cover
|
||||||
if self.keepdb:
|
if self.keepdb:
|
||||||
argv.append("--reuse-db")
|
argv.append("--reuse-db")
|
||||||
|
|
||||||
|
if any("tests/e2e" in label for label in test_labels):
|
||||||
|
argv.append("-pno:randomly")
|
||||||
|
|
||||||
argv.extend(test_labels)
|
argv.extend(test_labels)
|
||||||
return pytest.main(argv)
|
return pytest.main(argv)
|
||||||
|
|
|
@ -79,6 +79,7 @@ class TestProviderLDAP(SeleniumTestCase):
|
||||||
break
|
break
|
||||||
healthcheck_retries += 1
|
healthcheck_retries += 1
|
||||||
sleep(0.5)
|
sleep(0.5)
|
||||||
|
sleep(5)
|
||||||
return user, outpost
|
return user, outpost
|
||||||
|
|
||||||
@retry()
|
@retry()
|
||||||
|
@ -196,7 +197,7 @@ class TestProviderLDAP(SeleniumTestCase):
|
||||||
for obj in response:
|
for obj in response:
|
||||||
del obj["raw_attributes"]
|
del obj["raw_attributes"]
|
||||||
del obj["raw_dn"]
|
del obj["raw_dn"]
|
||||||
o_user = outpost.suer
|
o_user = outpost.user
|
||||||
self.assertCountEqual(
|
self.assertCountEqual(
|
||||||
response,
|
response,
|
||||||
[
|
[
|
||||||
|
|
|
@ -7,7 +7,6 @@ from unittest.case import skipUnless
|
||||||
from docker.types import Healthcheck
|
from docker.types import Healthcheck
|
||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
from selenium.webdriver.support import expected_conditions as ec
|
from selenium.webdriver.support import expected_conditions as ec
|
||||||
from structlog.stdlib import get_logger
|
|
||||||
|
|
||||||
from authentik.core.models import Application
|
from authentik.core.models import Application
|
||||||
from authentik.core.tests.utils import create_test_cert
|
from authentik.core.tests.utils import create_test_cert
|
||||||
|
@ -23,8 +22,6 @@ from authentik.providers.oauth2.constants import (
|
||||||
from authentik.providers.oauth2.models import ClientTypes, OAuth2Provider, ScopeMapping
|
from authentik.providers.oauth2.models import ClientTypes, OAuth2Provider, ScopeMapping
|
||||||
from tests.e2e.utils import USER, SeleniumTestCase, apply_migration, object_manager, retry
|
from tests.e2e.utils import USER, SeleniumTestCase, apply_migration, object_manager, retry
|
||||||
|
|
||||||
LOGGER = get_logger()
|
|
||||||
|
|
||||||
|
|
||||||
@skipUnless(platform.startswith("linux"), "requires local docker")
|
@skipUnless(platform.startswith("linux"), "requires local docker")
|
||||||
class TestProviderOAuth2OAuth(SeleniumTestCase):
|
class TestProviderOAuth2OAuth(SeleniumTestCase):
|
||||||
|
|
|
@ -9,7 +9,6 @@ from docker.models.containers import Container
|
||||||
from docker.types import Healthcheck
|
from docker.types import Healthcheck
|
||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
from selenium.webdriver.support import expected_conditions as ec
|
from selenium.webdriver.support import expected_conditions as ec
|
||||||
from structlog.stdlib import get_logger
|
|
||||||
|
|
||||||
from authentik.core.models import Application
|
from authentik.core.models import Application
|
||||||
from authentik.core.tests.utils import create_test_cert
|
from authentik.core.tests.utils import create_test_cert
|
||||||
|
@ -25,8 +24,6 @@ from authentik.providers.oauth2.constants import (
|
||||||
from authentik.providers.oauth2.models import ClientTypes, OAuth2Provider, ScopeMapping
|
from authentik.providers.oauth2.models import ClientTypes, OAuth2Provider, ScopeMapping
|
||||||
from tests.e2e.utils import USER, SeleniumTestCase, apply_migration, object_manager, retry
|
from tests.e2e.utils import USER, SeleniumTestCase, apply_migration, object_manager, retry
|
||||||
|
|
||||||
LOGGER = get_logger()
|
|
||||||
|
|
||||||
|
|
||||||
@skipUnless(platform.startswith("linux"), "requires local docker")
|
@skipUnless(platform.startswith("linux"), "requires local docker")
|
||||||
class TestProviderOAuth2OIDC(SeleniumTestCase):
|
class TestProviderOAuth2OIDC(SeleniumTestCase):
|
||||||
|
@ -63,7 +60,7 @@ class TestProviderOAuth2OIDC(SeleniumTestCase):
|
||||||
status = container.attrs.get("State", {}).get("Health", {}).get("Status")
|
status = container.attrs.get("State", {}).get("Health", {}).get("Status")
|
||||||
if status == "healthy":
|
if status == "healthy":
|
||||||
return container
|
return container
|
||||||
LOGGER.info("Container failed healthcheck")
|
self.logger.info("Container failed healthcheck")
|
||||||
sleep(1)
|
sleep(1)
|
||||||
|
|
||||||
@retry()
|
@retry()
|
||||||
|
|
|
@ -9,7 +9,6 @@ from docker.models.containers import Container
|
||||||
from docker.types import Healthcheck
|
from docker.types import Healthcheck
|
||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
from selenium.webdriver.support import expected_conditions as ec
|
from selenium.webdriver.support import expected_conditions as ec
|
||||||
from structlog.stdlib import get_logger
|
|
||||||
|
|
||||||
from authentik.core.models import Application
|
from authentik.core.models import Application
|
||||||
from authentik.core.tests.utils import create_test_cert
|
from authentik.core.tests.utils import create_test_cert
|
||||||
|
@ -25,8 +24,6 @@ from authentik.providers.oauth2.constants import (
|
||||||
from authentik.providers.oauth2.models import ClientTypes, OAuth2Provider, ScopeMapping
|
from authentik.providers.oauth2.models import ClientTypes, OAuth2Provider, ScopeMapping
|
||||||
from tests.e2e.utils import USER, SeleniumTestCase, apply_migration, object_manager, retry
|
from tests.e2e.utils import USER, SeleniumTestCase, apply_migration, object_manager, retry
|
||||||
|
|
||||||
LOGGER = get_logger()
|
|
||||||
|
|
||||||
|
|
||||||
@skipUnless(platform.startswith("linux"), "requires local docker")
|
@skipUnless(platform.startswith("linux"), "requires local docker")
|
||||||
class TestProviderOAuth2OIDCImplicit(SeleniumTestCase):
|
class TestProviderOAuth2OIDCImplicit(SeleniumTestCase):
|
||||||
|
@ -63,7 +60,7 @@ class TestProviderOAuth2OIDCImplicit(SeleniumTestCase):
|
||||||
status = container.attrs.get("State", {}).get("Health", {}).get("Status")
|
status = container.attrs.get("State", {}).get("Health", {}).get("Status")
|
||||||
if status == "healthy":
|
if status == "healthy":
|
||||||
return container
|
return container
|
||||||
LOGGER.info("Container failed healthcheck")
|
self.logger.info("Container failed healthcheck")
|
||||||
sleep(1)
|
sleep(1)
|
||||||
|
|
||||||
@retry()
|
@retry()
|
||||||
|
|
|
@ -9,7 +9,6 @@ from docker.models.containers import Container
|
||||||
from docker.types import Healthcheck
|
from docker.types import Healthcheck
|
||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
from selenium.webdriver.support import expected_conditions as ec
|
from selenium.webdriver.support import expected_conditions as ec
|
||||||
from structlog.stdlib import get_logger
|
|
||||||
|
|
||||||
from authentik.core.models import Application
|
from authentik.core.models import Application
|
||||||
from authentik.core.tests.utils import create_test_cert
|
from authentik.core.tests.utils import create_test_cert
|
||||||
|
@ -19,8 +18,6 @@ from authentik.policies.models import PolicyBinding
|
||||||
from authentik.providers.saml.models import SAMLBindings, SAMLPropertyMapping, SAMLProvider
|
from authentik.providers.saml.models import SAMLBindings, SAMLPropertyMapping, SAMLProvider
|
||||||
from tests.e2e.utils import USER, SeleniumTestCase, apply_migration, object_manager, retry
|
from tests.e2e.utils import USER, SeleniumTestCase, apply_migration, object_manager, retry
|
||||||
|
|
||||||
LOGGER = get_logger()
|
|
||||||
|
|
||||||
|
|
||||||
@skipUnless(platform.startswith("linux"), "requires local docker")
|
@skipUnless(platform.startswith("linux"), "requires local docker")
|
||||||
class TestProviderSAML(SeleniumTestCase):
|
class TestProviderSAML(SeleniumTestCase):
|
||||||
|
@ -58,7 +55,7 @@ class TestProviderSAML(SeleniumTestCase):
|
||||||
status = container.attrs.get("State", {}).get("Health", {}).get("Status")
|
status = container.attrs.get("State", {}).get("Health", {}).get("Status")
|
||||||
if status == "healthy":
|
if status == "healthy":
|
||||||
return container
|
return container
|
||||||
LOGGER.info("Container failed healthcheck")
|
self.logger.info("Container failed healthcheck")
|
||||||
sleep(1)
|
sleep(1)
|
||||||
|
|
||||||
@retry()
|
@retry()
|
||||||
|
|
|
@ -12,7 +12,6 @@ from selenium.webdriver.common.by import By
|
||||||
from selenium.webdriver.common.keys import Keys
|
from selenium.webdriver.common.keys import Keys
|
||||||
from selenium.webdriver.support import expected_conditions as ec
|
from selenium.webdriver.support import expected_conditions as ec
|
||||||
from selenium.webdriver.support.wait import WebDriverWait
|
from selenium.webdriver.support.wait import WebDriverWait
|
||||||
from structlog.stdlib import get_logger
|
|
||||||
from yaml import safe_dump
|
from yaml import safe_dump
|
||||||
|
|
||||||
from authentik.core.models import User
|
from authentik.core.models import User
|
||||||
|
@ -25,7 +24,6 @@ from authentik.stages.identification.models import IdentificationStage
|
||||||
from tests.e2e.utils import SeleniumTestCase, apply_migration, object_manager, retry
|
from tests.e2e.utils import SeleniumTestCase, apply_migration, object_manager, retry
|
||||||
|
|
||||||
CONFIG_PATH = "/tmp/dex.yml" # nosec
|
CONFIG_PATH = "/tmp/dex.yml" # nosec
|
||||||
LOGGER = get_logger()
|
|
||||||
|
|
||||||
|
|
||||||
class OAUth1Type(SourceType):
|
class OAUth1Type(SourceType):
|
||||||
|
|
|
@ -10,7 +10,6 @@ from selenium.webdriver.common.by import By
|
||||||
from selenium.webdriver.common.keys import Keys
|
from selenium.webdriver.common.keys import Keys
|
||||||
from selenium.webdriver.support import expected_conditions as ec
|
from selenium.webdriver.support import expected_conditions as ec
|
||||||
from selenium.webdriver.support.wait import WebDriverWait
|
from selenium.webdriver.support.wait import WebDriverWait
|
||||||
from structlog.stdlib import get_logger
|
|
||||||
|
|
||||||
from authentik.core.models import User
|
from authentik.core.models import User
|
||||||
from authentik.crypto.models import CertificateKeyPair
|
from authentik.crypto.models import CertificateKeyPair
|
||||||
|
@ -19,8 +18,6 @@ from authentik.sources.saml.models import SAMLBindingTypes, SAMLSource
|
||||||
from authentik.stages.identification.models import IdentificationStage
|
from authentik.stages.identification.models import IdentificationStage
|
||||||
from tests.e2e.utils import SeleniumTestCase, apply_migration, object_manager, retry
|
from tests.e2e.utils import SeleniumTestCase, apply_migration, object_manager, retry
|
||||||
|
|
||||||
LOGGER = get_logger()
|
|
||||||
|
|
||||||
IDP_CERT = """-----BEGIN CERTIFICATE-----
|
IDP_CERT = """-----BEGIN CERTIFICATE-----
|
||||||
MIIDXTCCAkWgAwIBAgIJALmVVuDWu4NYMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV
|
MIIDXTCCAkWgAwIBAgIJALmVVuDWu4NYMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV
|
||||||
BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
|
BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
|
||||||
|
|
Reference in New Issue