@@ -4,6 +4,7 @@ name: VM Execution Tests
44# Firecracker is Linux-only - these tests will not work on macOS/Windows
55# The scratchpad/firecracker-rust directory is gitignored (experimental code)
66# Tests will skip gracefully if the directory is not present
7+ # Triggered manually for adaptive concurrency testing
78
89on :
910 push :
@@ -94,18 +95,47 @@ jobs:
9495 runs-on : [self-hosted, linux, x64]
9596 timeout-minutes : 15
9697
97- services :
98- redis :
99- image : redis:7-alpine
100- ports :
101- - 6379:6379
102- options : >-
103- --health-cmd "redis-cli ping"
104- --health-interval 10s
105- --health-timeout 5s
106- --health-retries 5
98+ # NOTE: No services block - we check for existing Redis on self-hosted runner
99+ # and only start a container if none is available
107100
108101 steps :
102+ - name : Check for existing Redis
103+ id : redis_check
104+ run : |
105+ if redis-cli -h 127.0.0.1 -p 6379 ping 2>/dev/null | grep -q PONG; then
106+ echo "Redis is available on localhost:6379"
107+ echo "redis_available=true" >> $GITHUB_OUTPUT
108+ echo "redis_host=127.0.0.1" >> $GITHUB_OUTPUT
109+ echo "redis_port=6379" >> $GITHUB_OUTPUT
110+ echo "redis_started=false" >> $GITHUB_OUTPUT
111+ else
112+ echo "No Redis found, will start container on port 6380"
113+ echo "redis_available=false" >> $GITHUB_OUTPUT
114+ echo "redis_host=127.0.0.1" >> $GITHUB_OUTPUT
115+ echo "redis_port=6380" >> $GITHUB_OUTPUT
116+ echo "redis_started=true" >> $GITHUB_OUTPUT
117+ fi
118+
119+ - name : Start Redis container (if needed)
120+ if : steps.redis_check.outputs.redis_available == 'false'
121+ run : |
122+ docker run -d --name ci-redis-${{ github.run_id }} \
123+ -p 6380:6379 \
124+ --health-cmd "redis-cli ping" \
125+ --health-interval 10s \
126+ --health-timeout 5s \
127+ --health-retries 5 \
128+ redis:7-alpine
129+ # Wait for Redis to be healthy
130+ for i in {1..30}; do
131+ if redis-cli -h 127.0.0.1 -p 6380 ping 2>/dev/null | grep -q PONG; then
132+ echo "Redis container is ready"
133+ break
134+ fi
135+ echo "Waiting for Redis container... ($i/30)"
136+ sleep 2
137+ done
138+
109139 - name : Checkout code
110140 uses : actions/checkout@v6
111141
@@ -172,6 +202,10 @@ jobs:
172202
173203 - name : Run integration tests
174204 if : steps.check_fcctl.outputs.exists == 'true'
205+ env :
206+ REDIS_HOST : ${{ steps.redis_check.outputs.redis_host }}
207+ REDIS_PORT : ${{ steps.redis_check.outputs.redis_port }}
208+ REDIS_URL : redis://${{ steps.redis_check.outputs.redis_host }}:${{ steps.redis_check.outputs.redis_port }}
175209 run : |
176210 cd scratchpad/firecracker-rust/fcctl-web
177211 cargo test llm_api_tests \
@@ -180,6 +214,10 @@ jobs:
180214
181215 - name : Run HTTP API security tests
182216 if : steps.check_fcctl.outputs.exists == 'true'
217+ env :
218+ REDIS_HOST : ${{ steps.redis_check.outputs.redis_host }}
219+ REDIS_PORT : ${{ steps.redis_check.outputs.redis_port }}
220+ REDIS_URL : redis://${{ steps.redis_check.outputs.redis_host }}:${{ steps.redis_check.outputs.redis_port }}
183221 run : |
184222 cd scratchpad/firecracker-rust/fcctl-web
185223 cargo test security_tests \
@@ -197,6 +235,12 @@ jobs:
197235 kill $FCCTL_WEB_PID || true
198236 fi
199237
238+ - name : Stop Redis container (if started)
239+ if : always() && steps.redis_check.outputs.redis_started == 'true'
240+ run : |
241+ docker stop ci-redis-${{ github.run_id }} || true
242+ docker rm ci-redis-${{ github.run_id }} || true
243+
200244 websocket-tests :
201245 name : WebSocket Tests
202246 runs-on : [self-hosted, linux, x64]
0 commit comments