From f27b43507cb7c3dadfbfdbcdfbcd6435cc387aa6 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 26 Sep 2020 19:08:37 +0200 Subject: [PATCH] ci: ensure same checks as locally are run --- Makefile | 8 ++++---- azure-pipelines.yml | 10 +++++----- e2e/test_source_oauth.py | 9 +++++---- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index ef962bec0..bfbbb4761 100644 --- a/Makefile +++ b/Makefile @@ -8,13 +8,13 @@ coverage: lint-fix: isort -rc . - black . + black passbook e2e lifecycle lint: - pyright - bandit -r . + pyright pyright e2e lifecycle + bandit -r passbook e2e lifecycle pylint passbook e2e lifecycle - prospector + prospector passbook e2e lifecycle gen: coverage ./manage.py generate_swagger -o swagger.yaml -f yaml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ad8a88973..6f566210d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -30,7 +30,7 @@ stages: pipenv install --dev - task: CmdLine@2 inputs: - script: pipenv run pylint passbook + script: pipenv run pylint passbook e2e lifecycle - job: black pool: vmImage: 'ubuntu-latest' @@ -45,7 +45,7 @@ stages: pipenv install --dev - task: CmdLine@2 inputs: - script: pipenv run black --check passbook + script: pipenv run black --check passbook e2e lifecycle - job: prospector pool: vmImage: 'ubuntu-latest' @@ -61,7 +61,7 @@ stages: pipenv install --dev prospector --skip-lock - task: CmdLine@2 inputs: - script: pipenv run prospector passbook + script: pipenv run prospector passbook e2e lifecycle - job: bandit pool: vmImage: 'ubuntu-latest' @@ -76,7 +76,7 @@ stages: pipenv install --dev - task: CmdLine@2 inputs: - script: pipenv run bandit -r passbook + script: pipenv run bandit -r passbook e2e lifecycle - job: pyright pool: vmImage: ubuntu-latest @@ -97,7 +97,7 @@ stages: pipenv install --dev - task: CmdLine@2 inputs: - script: pipenv run pyright + script: pipenv run pyright e2e lifecycle - stage: Test jobs: - job: migrations diff --git a/e2e/test_source_oauth.py b/e2e/test_source_oauth.py index 6951f97bc..56f7279cf 100644 --- a/e2e/test_source_oauth.py +++ b/e2e/test_source_oauth.py @@ -22,7 +22,6 @@ from passbook.providers.oauth2.generators import ( ) from passbook.sources.oauth.models import OAuthSource -TOKEN_URL = "http://127.0.0.1:5556/dex/token" CONFIG_PATH = "/tmp/dex.yml" LOGGER = get_logger() @@ -94,14 +93,14 @@ class TestSourceOAuth2(SeleniumTestCase): authentication_flow = Flow.objects.get(slug="default-source-authentication") enrollment_flow = Flow.objects.get(slug="default-source-enrollment") - OAuthSource.objects.create( + OAuthSource.objects.create( # nosec name="dex", slug="dex", authentication_flow=authentication_flow, enrollment_flow=enrollment_flow, provider_type="openid-connect", authorization_url="http://127.0.0.1:5556/dex/auth", - access_token_url=TOKEN_URL, + access_token_url="http://127.0.0.1:5556/dex/token", profile_url="http://127.0.0.1:5556/dex/userinfo", consumer_key="example-app", consumer_secret=self.client_secret, @@ -247,6 +246,8 @@ class TestSourceOAuth2(SeleniumTestCase): @skipUnless(platform.startswith("linux"), "requires local docker") class TestSourceOAuth1(SeleniumTestCase): + """Test OAuth1 Source""" + def setUp(self) -> None: self.client_id = generate_client_id() self.client_secret = generate_client_secret() @@ -277,7 +278,7 @@ class TestSourceOAuth1(SeleniumTestCase): authentication_flow = Flow.objects.get(slug="default-source-authentication") enrollment_flow = Flow.objects.get(slug="default-source-enrollment") - OAuthSource.objects.create( + OAuthSource.objects.create( # nosec name="oauth1", slug=self.source_slug, authentication_flow=authentication_flow,