Skip to content

Commit 00b7bac

Browse files
committed
Configure HAProxy stats and improve test fixture cleanup logic
- Set up HAProxy stats environment variables (`HAPROXY_USERNAME`, `HAPROXY_PASSWORD`, `HAPROXY_STATS_PORT`) for monitoring. - Updated test fixture to ensure robust cleanup with try-finally blocks.
1 parent d926cd7 commit 00b7bac

2 files changed

Lines changed: 19 additions & 10 deletions

File tree

tests_e2e/docker/docker-compose-acme-e2e.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ services:
9494

9595
# EasyHAProxy with Certbot
9696
haproxy:
97+
image: byjg/easy-haproxy:local
9798
build:
9899
context: ../..
99100
dockerfile: deploy/docker/Dockerfile
@@ -111,6 +112,9 @@ services:
111112
environment:
112113
EASYHAPROXY_DISCOVER: docker
113114
HAPROXY_CUSTOMERRORS: "true"
115+
HAPROXY_USERNAME: admin
116+
HAPROXY_PASSWORD: password
117+
HAPROXY_STATS_PORT: 1936
114118

115119
# Certbot configuration pointing to Pebble
116120
EASYHAPROXY_CERTBOT_EMAIL: test@example.com

tests_e2e/test_docker_compose.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -842,16 +842,21 @@ def docker_compose_acme() -> Generator[None, None, None]:
842842
)
843843

844844
fixture = DockerComposeFixture(str(DOCKER_DIR / "docker-compose-acme-e2e.yml"), startup_wait=0)
845-
fixture.up()
846-
yield
847-
fixture.down()
848-
849-
# Clean up volume after test
850-
subprocess.run(
851-
["docker", "volume", "rm", volume_name],
852-
stdout=subprocess.DEVNULL,
853-
stderr=subprocess.DEVNULL
854-
)
845+
try:
846+
fixture.up()
847+
except Exception:
848+
fixture.down()
849+
raise
850+
try:
851+
yield
852+
finally:
853+
fixture.down()
854+
# Clean up volume after test
855+
subprocess.run(
856+
["docker", "volume", "rm", volume_name],
857+
stdout=subprocess.DEVNULL,
858+
stderr=subprocess.DEVNULL
859+
)
855860

856861

857862
@pytest.mark.acme

0 commit comments

Comments
 (0)