Skip SSL-free tests if not on SSL matrix

This commit is contained in:
0mar
2020-11-27 17:00:09 +01:00
parent 164447717f
commit 184d87ff2a
3 changed files with 10 additions and 1 deletions

View File

@@ -9,12 +9,12 @@ from urllib.parse import urlparse
import pytest import pytest
from traitlets.config import Config from traitlets.config import Config
from .. import orm
from ..utils import url_path_join as ujoin from ..utils import url_path_join as ujoin
from ..utils import wait_for_http_server from ..utils import wait_for_http_server
from .mocking import MockHub from .mocking import MockHub
from .test_api import add_user from .test_api import add_user
from .test_api import api_request from .test_api import api_request
from .utils import skip_if_ssl
@pytest.fixture @pytest.fixture
@@ -27,6 +27,7 @@ def disable_check_routes(app):
app.last_activity_callback.start() app.last_activity_callback.start()
@skip_if_ssl
async def test_external_proxy(request): async def test_external_proxy(request):
auth_token = 'secret!' auth_token = 'secret!'
proxy_ip = '127.0.0.1' proxy_ip = '127.0.0.1'

View File

@@ -17,6 +17,7 @@ from ..utils import url_path_join
from ..utils import wait_for_http_server from ..utils import wait_for_http_server
from .mocking import public_url from .mocking import public_url
from .utils import async_requests from .utils import async_requests
from .utils import skip_if_ssl
mockservice_path = os.path.dirname(os.path.abspath(__file__)) mockservice_path = os.path.dirname(os.path.abspath(__file__))
mockservice_py = os.path.join(mockservice_path, 'mockservice.py') mockservice_py = os.path.join(mockservice_path, 'mockservice.py')
@@ -63,6 +64,7 @@ async def test_managed_service(mockservice):
assert service.proc.poll() is None assert service.proc.poll() is None
@skip_if_ssl
async def test_proxy_service(app, mockservice_url): async def test_proxy_service(app, mockservice_url):
service = mockservice_url service = mockservice_url
name = service.name name = service.name
@@ -76,6 +78,7 @@ async def test_proxy_service(app, mockservice_url):
assert r.text.endswith(path) assert r.text.endswith(path)
@skip_if_ssl
async def test_external_service(app): async def test_external_service(app):
name = 'external' name = 'external'
async with external_service(app, name=name) as env: async with external_service(app, name=name) as env:

View File

@@ -1,6 +1,8 @@
import asyncio import asyncio
import os
from concurrent.futures import ThreadPoolExecutor from concurrent.futures import ThreadPoolExecutor
import pytest
import requests import requests
from certipy import Certipy from certipy import Certipy
@@ -52,6 +54,9 @@ def ssl_setup(cert_dir, authority_name):
return external_certs return external_certs
skip_if_ssl = pytest.mark.skipif(os.environ.get('SSL_ENABLED', False))
def check_db_locks(func): def check_db_locks(func):
"""Decorator that verifies no locks are held on database upon exit. """Decorator that verifies no locks are held on database upon exit.