Skip to content

Commit e014d31

Browse files
committed
ci: fix VM execution tests for missing fcctl-web dependency
1 parent cdd9c7b commit e014d31

2 files changed

Lines changed: 130 additions & 40 deletions

File tree

.github/workflows/vm-execution-tests.yml

Lines changed: 71 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,18 @@ jobs:
232232
${{ runner.os }}-cargo-websocket-
233233
${{ runner.os }}-cargo-
234234
235+
- name: Check if fcctl-web exists
236+
id: check_fcctl_websocket
237+
run: |
238+
if [ -d "scratchpad/firecracker-rust/fcctl-web" ]; then
239+
echo "exists=true" >> $GITHUB_OUTPUT
240+
else
241+
echo "exists=false" >> $GITHUB_OUTPUT
242+
echo "⚠️ fcctl-web not found - skipping WebSocket tests (experimental code is gitignored)"
243+
fi
244+
235245
- name: Build and start fcctl-web
246+
if: steps.check_fcctl_websocket.outputs.exists == 'true'
236247
run: |
237248
cd scratchpad/firecracker-rust/fcctl-web
238249
cargo build --release
@@ -248,13 +259,18 @@ jobs:
248259
done
249260
250261
- name: Run WebSocket tests
262+
if: steps.check_fcctl_websocket.outputs.exists == 'true'
251263
run: |
252264
cd scratchpad/firecracker-rust/fcctl-web
253265
cargo test websocket_tests \
254266
--verbose \
255267
--ignored \
256268
-- --nocapture
257269
270+
- name: Skip message
271+
if: steps.check_fcctl_websocket.outputs.exists == 'false'
272+
run: echo "✅ Skipping WebSocket tests - fcctl-web experimental code not present (gitignored)"
273+
258274
- name: Stop server
259275
if: always()
260276
run: |
@@ -293,14 +309,26 @@ jobs:
293309
${{ runner.os }}-cargo-e2e-
294310
${{ runner.os }}-cargo-
295311
312+
- name: Check if fcctl-web exists
313+
id: check_fcctl_e2e
314+
run: |
315+
if [ -d "scratchpad/firecracker-rust/fcctl-web" ]; then
316+
echo "exists=true" >> $GITHUB_OUTPUT
317+
else
318+
echo "exists=false" >> $GITHUB_OUTPUT
319+
echo "⚠️ fcctl-web not found - skipping E2E tests (experimental code is gitignored)"
320+
fi
321+
296322
- name: Build all components
323+
if: steps.check_fcctl_e2e.outputs.exists == 'true'
297324
run: |
298325
cargo build --release
299326
cd scratchpad/firecracker-rust/fcctl-web
300327
cargo build --release
301328
cd -
302329
303330
- name: Start fcctl-web server
331+
if: steps.check_fcctl_e2e.outputs.exists == 'true'
304332
run: |
305333
cd scratchpad/firecracker-rust/fcctl-web
306334
./target/release/fcctl-web &
@@ -316,6 +344,7 @@ jobs:
316344
done
317345
318346
- name: Run end-to-end tests
347+
if: steps.check_fcctl_e2e.outputs.exists == 'true'
319348
run: |
320349
cargo test agent_vm_integration_tests \
321350
--verbose \
@@ -324,12 +353,17 @@ jobs:
324353
--test-threads=1
325354
326355
- name: Test agent configuration
356+
if: steps.check_fcctl_e2e.outputs.exists == 'true'
327357
run: |
328358
cargo test test_agent_with_vm_execution \
329359
--verbose \
330360
--ignored \
331361
-- --nocapture
332362
363+
- name: Skip message
364+
if: steps.check_fcctl_e2e.outputs.exists == 'false'
365+
run: echo "✅ Skipping E2E tests - fcctl-web experimental code not present (gitignored)"
366+
333367
- name: Stop server
334368
if: always()
335369
run: |
@@ -605,6 +639,16 @@ jobs:
605639
${{ runner.os }}-cargo-coverage-
606640
${{ runner.os }}-cargo-
607641
642+
- name: Check if fcctl-web exists for coverage
643+
id: check_fcctl_coverage
644+
run: |
645+
if [ -d "scratchpad/firecracker-rust/fcctl-web" ]; then
646+
echo "exists=true" >> $GITHUB_OUTPUT
647+
else
648+
echo "exists=false" >> $GITHUB_OUTPUT
649+
echo "⚠️ fcctl-web not found - running coverage without integration tests (experimental code is gitignored)"
650+
fi
651+
608652
- name: Run tests with coverage
609653
env:
610654
CARGO_INCREMENTAL: 0
@@ -614,28 +658,33 @@ jobs:
614658
# Unit tests
615659
cargo test -p terraphim_multi_agent vm_execution
616660
617-
# Build fcctl-web
618-
cd scratchpad/firecracker-rust/fcctl-web
619-
cargo build
620-
./target/debug/fcctl-web &
621-
FCCTL_WEB_PID=$!
622-
cd -
623-
624-
# Wait for server
625-
for i in {1..30}; do
626-
if curl -s http://localhost:8080/health > /dev/null 2>&1; then
627-
break
628-
fi
629-
sleep 2
630-
done
631-
632-
# Integration tests (with mock data to avoid needing real VMs)
633-
cd scratchpad/firecracker-rust/fcctl-web
634-
cargo test llm_api_tests || true # Allow failure for coverage
635-
cd -
636-
637-
# Stop server
638-
kill $FCCTL_WEB_PID || true
661+
# Build fcctl-web and run integration tests if available
662+
if [ "${{ steps.check_fcctl_coverage.outputs.exists }}" == "true" ]; then
663+
# Build fcctl-web
664+
cd scratchpad/firecracker-rust/fcctl-web
665+
cargo build
666+
./target/debug/fcctl-web &
667+
FCCTL_WEB_PID=$!
668+
cd -
669+
670+
# Wait for server
671+
for i in {1..30}; do
672+
if curl -s http://localhost:8080/health > /dev/null 2>&1; then
673+
break
674+
fi
675+
sleep 2
676+
done
677+
678+
# Integration tests (with mock data to avoid needing real VMs)
679+
cd scratchpad/firecracker-rust/fcctl-web
680+
cargo test llm_api_tests || true # Allow failure for coverage
681+
cd -
682+
683+
# Stop server
684+
kill $FCCTL_WEB_PID || true
685+
else
686+
echo "Skipping fcctl-web integration tests for coverage - experimental code not present"
687+
fi
639688
640689
- name: Generate coverage report
641690
run: |

scripts/test-vm-execution.sh

Lines changed: 59 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,22 @@ check_dependencies() {
202202
exit 1
203203
fi
204204

205-
# Check for fcctl-web binary if we need to start server
206-
if [ "$START_SERVER" = true ]; then
207-
if [ ! -f "scratchpad/firecracker-rust/fcctl-web/target/debug/fcctl-web" ] &&
208-
[ ! -f "scratchpad/firecracker-rust/fcctl-web/target/release/fcctl-web" ]; then
209-
log_info "Building fcctl-web server..."
210-
cd scratchpad/firecracker-rust/fcctl-web
211-
cargo build --release
212-
cd - > /dev/null
205+
# Check if fcctl-web directory exists
206+
if [ ! -d "scratchpad/firecracker-rust/fcctl-web" ]; then
207+
log_warning "fcctl-web directory not found (scratchpad/firecracker-rust/fcctl-web)"
208+
log_warning "This is expected for CI environments - experimental code is gitignored"
209+
export NO_FCCTL_WEB=true
210+
else
211+
export NO_FCCTL_WEB=false
212+
# Check for fcctl-web binary if we need to start server
213+
if [ "$START_SERVER" = true ]; then
214+
if [ ! -f "scratchpad/firecracker-rust/fcctl-web/target/debug/fcctl-web" ] &&
215+
[ ! -f "scratchpad/firecracker-rust/fcctl-web/target/release/fcctl-web" ]; then
216+
log_info "Building fcctl-web server..."
217+
cd scratchpad/firecracker-rust/fcctl-web
218+
cargo build --release
219+
cd - > /dev/null
220+
fi
213221
fi
214222
fi
215223

@@ -222,6 +230,11 @@ start_server() {
222230
return
223231
fi
224232

233+
if [ "${NO_FCCTL_WEB:-false}" = true ]; then
234+
log_warning "Skipping fcctl-web server start - directory not present (expected for CI)"
235+
return
236+
fi
237+
225238
log_info "Starting fcctl-web server..."
226239

227240
cd scratchpad/firecracker-rust/fcctl-web
@@ -257,6 +270,11 @@ start_server() {
257270
check_server() {
258271
log_info "Checking fcctl-web server availability..."
259272

273+
if [ "${NO_FCCTL_WEB:-false}" = true ]; then
274+
log_warning "Skipping server check - fcctl-web not present (expected for CI)"
275+
return
276+
fi
277+
260278
if curl -s "$FCCTL_WEB_URL/health" > /dev/null 2>&1; then
261279
log_success "fcctl-web server is available at $FCCTL_WEB_URL"
262280
else
@@ -290,6 +308,11 @@ run_unit_tests() {
290308
run_integration_tests() {
291309
log_info "Running integration tests..."
292310

311+
if [ "${NO_FCCTL_WEB:-false}" = true ]; then
312+
log_warning "Skipping integration tests - fcctl-web not present (expected for CI)"
313+
return 0
314+
fi
315+
293316
cd scratchpad/firecracker-rust/fcctl-web
294317

295318
local test_args=()
@@ -313,6 +336,11 @@ run_integration_tests() {
313336
run_websocket_tests() {
314337
log_info "Running WebSocket tests..."
315338

339+
if [ "${NO_FCCTL_WEB:-false}" = true ]; then
340+
log_warning "Skipping WebSocket tests - fcctl-web not present (expected for CI)"
341+
return 0
342+
fi
343+
316344
cd scratchpad/firecracker-rust/fcctl-web
317345

318346
local test_args=("--ignored")
@@ -336,6 +364,11 @@ run_websocket_tests() {
336364
run_e2e_tests() {
337365
log_info "Running end-to-end tests..."
338366

367+
if [ "${NO_FCCTL_WEB:-false}" = true ]; then
368+
log_warning "Skipping end-to-end tests - fcctl-web not present (expected for CI)"
369+
return 0
370+
fi
371+
339372
local test_args=("--ignored")
340373
if [ "$VERBOSE" = true ]; then
341374
test_args+=("--" "--nocapture")
@@ -363,12 +396,16 @@ run_security_tests() {
363396
fi
364397

365398
# Integration security tests
366-
cd scratchpad/firecracker-rust/fcctl-web
367-
if ! cargo test security_tests 2>&1 | tee -a "../../../$LOG_FILE"; then
368-
log_error "Integration security tests failed"
369-
result=1
399+
if [ "${NO_FCCTL_WEB:-false}" = false ]; then
400+
cd scratchpad/firecracker-rust/fcctl-web
401+
if ! cargo test security_tests 2>&1 | tee -a "../../../$LOG_FILE"; then
402+
log_error "Integration security tests failed"
403+
result=1
404+
fi
405+
cd - > /dev/null
406+
else
407+
log_warning "Skipping integration security tests - fcctl-web not present (expected for CI)"
370408
fi
371-
cd - > /dev/null
372409

373410
if [ $result -eq 0 ]; then
374411
log_success "Security tests passed"
@@ -390,12 +427,16 @@ run_performance_tests() {
390427
fi
391428

392429
# Integration performance tests
393-
cd scratchpad/firecracker-rust/fcctl-web
394-
if ! cargo test websocket_performance_tests --ignored --release 2>&1 | tee -a "../../../$LOG_FILE"; then
395-
log_error "WebSocket performance tests failed"
396-
result=1
430+
if [ "${NO_FCCTL_WEB:-false}" = false ]; then
431+
cd scratchpad/firecracker-rust/fcctl-web
432+
if ! cargo test websocket_performance_tests --ignored --release 2>&1 | tee -a "../../../$LOG_FILE"; then
433+
log_error "WebSocket performance tests failed"
434+
result=1
435+
fi
436+
cd - > /dev/null
437+
else
438+
log_warning "Skipping integration performance tests - fcctl-web not present (expected for CI)"
397439
fi
398-
cd - > /dev/null
399440

400441
# Agent performance tests
401442
if ! cargo test agent_performance_tests --ignored --release 2>&1 | tee -a "$LOG_FILE"; then

0 commit comments

Comments
 (0)