]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Test] Fix integration test environment variable passing
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 20 Oct 2025 07:45:42 +0000 (08:45 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 20 Oct 2025 07:45:42 +0000 (08:45 +0100)
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
test/integration/scripts/integration-test.sh

index bda9c93ad8fd0d06ea3c04c655a8cda168cf3e54..ab5f4b9973ece85d47b6cae9cc7f68dc632dc0a0 100644 (file)
@@ -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
index 4cc80a34d68cd5577b7c2929d59d30ae3a7116ac..c02cb98a3c8e9ab4c0f25635d3f5d171e9bfff1b 100755 (executable)
@@ -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