Set pytest.fixture scope to class, add Swarm E2E tests, and update Docker Swarm configurations
- Modified `pytest.fixture` scope to `class` across tests to improve fixture lifecycle and reduce setup overhead. - Introduced a new `tests_e2e/test_swarm.py` test suite for Docker Swarm stack configurations. - Added E2E tests for Swarm mode with scenarios such as basic services and combined plugins. - Updated HAProxy image in Swarm stack `.yml` files to `byjg/easy-haproxy:local` for local testing consistency. - Added `swarm` marker in `pyproject.toml` for differentiating Docker Swarm-specific tests. - Updated GitHub workflows to include a new Swarm E2E test pipeline.
This commit is contained in:
parent
16fcee4280
commit
d9c7ff89cc
11 changed files with 682 additions and 22 deletions
|
|
@ -476,7 +476,7 @@ class KubernetesFixture:
|
|||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@pytest.fixture(scope="class")
|
||||
def k8s_service(kind_cluster) -> Generator[str, None, None]:
|
||||
"""Fixture for service.yml"""
|
||||
kubectl_cmd = kind_cluster["kubectl"]
|
||||
|
|
@ -486,7 +486,7 @@ def k8s_service(kind_cluster) -> Generator[str, None, None]:
|
|||
fixture.delete()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@pytest.fixture(scope="class")
|
||||
def k8s_ip_whitelist(kind_cluster) -> Generator[str, None, None]:
|
||||
"""Fixture for ip-whitelist.yml"""
|
||||
kubectl_cmd = kind_cluster["kubectl"]
|
||||
|
|
@ -496,7 +496,7 @@ def k8s_ip_whitelist(kind_cluster) -> Generator[str, None, None]:
|
|||
fixture.delete()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@pytest.fixture(scope="class")
|
||||
def k8s_service_tls(kind_cluster) -> Generator[str, None, None]:
|
||||
"""Fixture for service_tls.yml with generated certificates"""
|
||||
kubectl_cmd = kind_cluster["kubectl"]
|
||||
|
|
@ -573,7 +573,7 @@ def k8s_service_tls(kind_cluster) -> Generator[str, None, None]:
|
|||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@pytest.fixture(scope="class")
|
||||
def k8s_jwt_validator_secret(kind_cluster) -> Generator[dict, None, None]:
|
||||
"""Fixture for jwt-validator-secret-example.yml with generated JWT keys"""
|
||||
if not JWT_AVAILABLE:
|
||||
|
|
@ -665,7 +665,7 @@ def k8s_jwt_validator_secret(kind_cluster) -> Generator[dict, None, None]:
|
|||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@pytest.fixture(scope="class")
|
||||
def k8s_cloudflare(kind_cluster, kind_cmd) -> Generator[str, None, None]:
|
||||
"""Fixture for cloudflare.yml with base64-encoded IP list"""
|
||||
kubectl_cmd = kind_cluster["kubectl"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue