1
0
Fork 0

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.
This commit is contained in:
Joao Gilberto Magalhaes 2026-02-22 20:51:16 -05:00
parent d926cd7e69
commit 00b7bac5c0
2 changed files with 19 additions and 10 deletions

View file

@ -94,6 +94,7 @@ services:
# EasyHAProxy with Certbot
haproxy:
image: byjg/easy-haproxy:local
build:
context: ../..
dockerfile: deploy/docker/Dockerfile
@ -111,6 +112,9 @@ services:
environment:
EASYHAPROXY_DISCOVER: docker
HAPROXY_CUSTOMERRORS: "true"
HAPROXY_USERNAME: admin
HAPROXY_PASSWORD: password
HAPROXY_STATS_PORT: 1936
# Certbot configuration pointing to Pebble
EASYHAPROXY_CERTBOT_EMAIL: test@example.com

View file

@ -842,16 +842,21 @@ def docker_compose_acme() -> Generator[None, None, None]:
)
fixture = DockerComposeFixture(str(DOCKER_DIR / "docker-compose-acme-e2e.yml"), startup_wait=0)
fixture.up()
yield
fixture.down()
# Clean up volume after test
subprocess.run(
["docker", "volume", "rm", volume_name],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL
)
try:
fixture.up()
except Exception:
fixture.down()
raise
try:
yield
finally:
fixture.down()
# Clean up volume after test
subprocess.run(
["docker", "volume", "rm", volume_name],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL
)
@pytest.mark.acme