ci: ensure same checks as locally are run

This commit is contained in:
Jens Langhammer 2020-09-26 19:08:37 +02:00
parent c1058c7438
commit f27b43507c
3 changed files with 14 additions and 13 deletions

View File

@ -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

View File

@ -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

View File

@ -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,