From 8737a72896929d05d13f025e43b1552eff8f42db Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 20 Oct 2025 08:45:42 +0100 Subject: [PATCH] [Test] Fix integration test environment variable passing Pass environment variables explicitly when executing the test script inside the Docker container using docker compose exec -e. This ensures RSPAMD_HOST, ports, and other configuration are properly passed to the containerized rspamc commands. Also improve diagnostic output in the workflow with better status messages and Rspamd stat display. --- .github/workflows/integration-test.yml | 21 +++++++++++++++----- test/integration/scripts/integration-test.sh | 11 +++++++++- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index bda9c93ad8..ab5f4b9973 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -210,24 +210,35 @@ jobs: - name: Wait for Rspamd to be ready working-directory: test/integration run: | + echo "Waiting for Rspamd services to initialize..." + + # Wait for healthcheck to pass for i in {1..60}; do if curl -s http://localhost:50002/ping > /dev/null 2>&1; then - echo "Rspamd Controller is ready!" + echo "✓ Rspamd Controller is ready!" # Also check proxy if curl -s http://localhost:50004/ping > /dev/null 2>&1; then - echo "Rspamd Proxy is ready!" + echo "✓ Rspamd Proxy is ready!" else - echo "WARNING: Proxy not responding, but continuing..." + echo "⚠ WARNING: Proxy not responding, but continuing..." fi + # Show Rspamd stat + echo "" + echo "=== Rspamd Status ===" + curl -s http://localhost:50002/stat 2>/dev/null | head -20 || echo "Cannot get stat" + exit 0 fi - echo "Waiting for Rspamd... ($i/60)" + echo "Waiting for Rspamd... (attempt $i/60)" sleep 3 done - echo "Rspamd failed to start!" + echo "❌ Rspamd failed to start within timeout!" + echo "" + echo "=== Docker Compose Status ===" + docker compose ps echo "" echo "=== Full Rspamd logs ===" docker compose logs rspamd diff --git a/test/integration/scripts/integration-test.sh b/test/integration/scripts/integration-test.sh index 4cc80a34d6..c02cb98a3c 100755 --- a/test/integration/scripts/integration-test.sh +++ b/test/integration/scripts/integration-test.sh @@ -45,7 +45,16 @@ echo "" # Check if rspamc is available if ! command -v rspamc &> /dev/null; then echo "ERROR: rspamc not found. Running inside docker container..." - exec docker compose exec -T rspamd bash -s < "$0" + exec docker compose exec -T \ + -e RSPAMD_HOST="$RSPAMD_HOST" \ + -e CONTROLLER_PORT="$CONTROLLER_PORT" \ + -e PROXY_PORT="$PROXY_PORT" \ + -e PASSWORD="$PASSWORD" \ + -e PARALLEL="$PARALLEL" \ + -e TRAIN_RATIO="$TRAIN_RATIO" \ + -e TEST_PROXY="$TEST_PROXY" \ + -e ASAN_OPTIONS="detect_leaks=0" \ + rspamd bash -s < "$0" fi # Check if Rspamd is running -- 2.47.3