Skip to content

Commit

Permalink
Remove consul and etcd proxy ref from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgianaElena authored and alexleach committed Jul 18, 2021
1 parent 4d4e051 commit 23c3c3c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 157 deletions.
153 changes: 0 additions & 153 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import pytest
from _pytest.mark import Mark

from jupyterhub_traefik_proxy import TraefikEtcdProxy
from jupyterhub_traefik_proxy import TraefikConsulProxy
from jupyterhub_traefik_proxy import TraefikFileProviderProxy


Expand All @@ -37,88 +35,6 @@ def pytest_configure(config):
config.addinivalue_line("markers", "slow: marks tests as slow.")


@pytest.fixture
async def no_auth_consul_proxy(consul_no_acl):
"""
Fixture returning a configured TraefikConsulProxy.
Consul acl disabled.
"""
proxy = TraefikConsulProxy(
public_url="http://127.0.0.1:8000",
traefik_api_password="admin",
traefik_api_username="api_admin",
check_route_timeout=45,
should_start=True,
)
await proxy.start()
yield proxy
await proxy.stop()


@pytest.fixture
async def auth_consul_proxy(consul_acl):
"""
Fixture returning a configured TraefikConsulProxy.
Consul acl enabled.
"""
proxy = TraefikConsulProxy(
public_url="http://127.0.0.1:8000",
traefik_api_password="admin",
traefik_api_username="api_admin",
kv_password="secret",
check_route_timeout=45,
should_start=True,
)
await proxy.start()
yield proxy
await proxy.stop()


@pytest.fixture
async def no_auth_etcd_proxy():
"""
Fixture returning a configured TraefikEtcdProxy.
No etcd authentication.
"""
proxy = TraefikEtcdProxy(
public_url="http://127.0.0.1:8000",
traefik_api_password="admin",
traefik_api_username="api_admin",
check_route_timeout=45,
should_start=True,
)
await proxy.start()
yield proxy
await proxy.stop()


@pytest.fixture
async def auth_etcd_proxy(etcd):
"""
Fixture returning a configured TraefikEtcdProxy
Etcd has credentials set up
"""
enable_auth_in_etcd("secret")
proxy = TraefikEtcdProxy(
public_url="http://127.0.0.1:8000",
traefik_api_password="admin",
traefik_api_username="api_admin",
kv_password="secret",
kv_username="root",
check_route_timeout=45,
should_start=True,
)
await proxy.start()
yield proxy
await proxy.stop()
disable_auth_in_etcd("secret")


@pytest.fixture(params=["no_auth_etcd_proxy", "auth_etcd_proxy"])
def etcd_proxy(request):
return request.getfixturevalue(request.param)


# There must be a way to parameterise this to run on both yaml and toml files?
@pytest.fixture
async def toml_proxy():
Expand Down Expand Up @@ -161,75 +77,6 @@ async def yaml_proxy():
await proxy.stop()


@pytest.fixture
def external_consul_proxy(consul_no_acl):
proxy = TraefikConsulProxy(
public_url="http://127.0.0.1:8000",
traefik_api_password="admin",
traefik_api_username="api_admin",
check_route_timeout=45,
should_start=False,
)
traefik_process = configure_and_launch_traefik(kv_store="consul")
yield proxy

traefik_process.kill()
traefik_process.wait()


@pytest.fixture
def auth_external_consul_proxy(consul_acl):
proxy = TraefikConsulProxy(
public_url="http://127.0.0.1:8000",
traefik_api_password="admin",
traefik_api_username="api_admin",
kv_password="secret",
check_route_timeout=45,
should_start=False,
)
traefik_process = configure_and_launch_traefik(kv_store="consul", password="secret")
yield proxy

traefik_process.kill()
traefik_process.wait()


@pytest.fixture
def external_etcd_proxy():
proxy = TraefikEtcdProxy(
public_url="http://127.0.0.1:8000",
traefik_api_password="admin",
traefik_api_username="api_admin",
check_route_timeout=45,
should_start=False,
)
traefik_process = configure_and_launch_traefik(kv_store="etcd")
yield proxy

traefik_process.kill()
traefik_process.wait()


@pytest.fixture
def auth_external_etcd_proxy():
enable_auth_in_etcd("secret")
proxy = TraefikEtcdProxy(
public_url="http://127.0.0.1:8000",
traefik_api_password="admin",
traefik_api_username="api_admin",
kv_password="secret",
kv_username="root",
check_route_timeout=45,
should_start=False,
)
traefik_process = configure_and_launch_traefik(kv_store="etcd", password="secret")
yield proxy

traefik_process.kill()
traefik_process.wait()
disable_auth_in_etcd("secret")


@pytest.fixture
async def external_toml_proxy(launch_traefik_file):
dynamic_config_file = os.path.join(
Expand Down
4 changes: 0 additions & 4 deletions tests/test_traefik_api_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
params=[
"toml_proxy",
"yaml_proxy",
#"no_auth_etcd_proxy",
#"auth_etcd_proxy",
#"no_auth_consul_proxy",
#"auth_consul_proxy",
]
)
def proxy(request):
Expand Down

0 comments on commit 23c3c3c

Please sign in to comment.