tests/e2e: remove logger

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-11-23 19:25:31 +01:00
parent 91fd792f88
commit b2d2e7cbc8
9 changed files with 9 additions and 22 deletions

View File

@ -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"""
uid = generate_id(20) if not name else name
group = Group.objects.create(name=uid, is_superuser=True)

View File

@ -40,5 +40,8 @@ class PytestTestRunner: # pragma: no cover
if self.keepdb:
argv.append("--reuse-db")
if any("tests/e2e" in label for label in test_labels):
argv.append("-pno:randomly")
argv.extend(test_labels)
return pytest.main(argv)

View File

@ -79,6 +79,7 @@ class TestProviderLDAP(SeleniumTestCase):
break
healthcheck_retries += 1
sleep(0.5)
sleep(5)
return user, outpost
@retry()
@ -196,7 +197,7 @@ class TestProviderLDAP(SeleniumTestCase):
for obj in response:
del obj["raw_attributes"]
del obj["raw_dn"]
o_user = outpost.suer
o_user = outpost.user
self.assertCountEqual(
response,
[

View File

@ -7,7 +7,6 @@ from unittest.case import skipUnless
from docker.types import Healthcheck
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as ec
from structlog.stdlib import get_logger
from authentik.core.models import Application
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 tests.e2e.utils import USER, SeleniumTestCase, apply_migration, object_manager, retry
LOGGER = get_logger()
@skipUnless(platform.startswith("linux"), "requires local docker")
class TestProviderOAuth2OAuth(SeleniumTestCase):

View File

@ -9,7 +9,6 @@ from docker.models.containers import Container
from docker.types import Healthcheck
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as ec
from structlog.stdlib import get_logger
from authentik.core.models import Application
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 tests.e2e.utils import USER, SeleniumTestCase, apply_migration, object_manager, retry
LOGGER = get_logger()
@skipUnless(platform.startswith("linux"), "requires local docker")
class TestProviderOAuth2OIDC(SeleniumTestCase):
@ -63,7 +60,7 @@ class TestProviderOAuth2OIDC(SeleniumTestCase):
status = container.attrs.get("State", {}).get("Health", {}).get("Status")
if status == "healthy":
return container
LOGGER.info("Container failed healthcheck")
self.logger.info("Container failed healthcheck")
sleep(1)
@retry()

View File

@ -9,7 +9,6 @@ from docker.models.containers import Container
from docker.types import Healthcheck
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as ec
from structlog.stdlib import get_logger
from authentik.core.models import Application
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 tests.e2e.utils import USER, SeleniumTestCase, apply_migration, object_manager, retry
LOGGER = get_logger()
@skipUnless(platform.startswith("linux"), "requires local docker")
class TestProviderOAuth2OIDCImplicit(SeleniumTestCase):
@ -63,7 +60,7 @@ class TestProviderOAuth2OIDCImplicit(SeleniumTestCase):
status = container.attrs.get("State", {}).get("Health", {}).get("Status")
if status == "healthy":
return container
LOGGER.info("Container failed healthcheck")
self.logger.info("Container failed healthcheck")
sleep(1)
@retry()

View File

@ -9,7 +9,6 @@ from docker.models.containers import Container
from docker.types import Healthcheck
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as ec
from structlog.stdlib import get_logger
from authentik.core.models import Application
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 tests.e2e.utils import USER, SeleniumTestCase, apply_migration, object_manager, retry
LOGGER = get_logger()
@skipUnless(platform.startswith("linux"), "requires local docker")
class TestProviderSAML(SeleniumTestCase):
@ -58,7 +55,7 @@ class TestProviderSAML(SeleniumTestCase):
status = container.attrs.get("State", {}).get("Health", {}).get("Status")
if status == "healthy":
return container
LOGGER.info("Container failed healthcheck")
self.logger.info("Container failed healthcheck")
sleep(1)
@retry()

View File

@ -12,7 +12,6 @@ from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.support.wait import WebDriverWait
from structlog.stdlib import get_logger
from yaml import safe_dump
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
CONFIG_PATH = "/tmp/dex.yml" # nosec
LOGGER = get_logger()
class OAUth1Type(SourceType):

View File

@ -10,7 +10,6 @@ from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.support.wait import WebDriverWait
from structlog.stdlib import get_logger
from authentik.core.models import User
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 tests.e2e.utils import SeleniumTestCase, apply_migration, object_manager, retry
LOGGER = get_logger()
IDP_CERT = """-----BEGIN CERTIFICATE-----
MIIDXTCCAkWgAwIBAgIJALmVVuDWu4NYMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV
BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX