Skip to content

Commit a4fd1a4

Browse files
fix: Update vision tests to reflect current API state
The /api/vision endpoint is not yet implemented in server.rs. Vision feature compiles successfully but HTTP API pending. Updated tests to: - Test server health endpoint (works) - Test /v1/models endpoint (works) - Note that /api/vision is not yet implemented - Update summary table to reflect accurate status
1 parent ed607d2 commit a4fd1a4

1 file changed

Lines changed: 55 additions & 56 deletions

File tree

.github/workflows/vision-cross-platform-test.yml

Lines changed: 55 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -253,59 +253,57 @@ jobs:
253253
echo "Server started with PID $SERVER_PID"
254254
255255
# Wait for server to be ready
256+
SERVER_READY="false"
256257
for i in {1..30}; do
257258
if curl -s http://127.0.0.1:11435/health > /dev/null 2>&1; then
258259
echo "Server is ready"
260+
SERVER_READY="true"
259261
break
260262
fi
261263
echo "Waiting for server... ($i/30)"
262264
sleep 2
263265
done
264266
265-
# Download a test image
266-
curl -L -o test-ocr.png "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4f/SVG_Logo.svg/320px-SVG_Logo.svg.png"
267+
# Test health endpoint
268+
echo "Testing health endpoint..."
269+
curl -s http://127.0.0.1:11435/health > health-result.json || true
270+
echo "Health check result:"
271+
cat health-result.json
267272
268-
# Convert image to base64
269-
TEST_IMAGE_B64=$(base64 -w 0 test-ocr.png)
273+
# Test models endpoint (OpenAI compatible)
274+
echo "Testing models endpoint..."
275+
curl -s http://127.0.0.1:11435/v1/models > models-result.json || true
276+
echo "Models result:"
277+
cat models-result.json
270278
271-
echo "Running Vision API test..."
272-
curl -s -X POST http://127.0.0.1:11435/api/vision \
273-
-H "Content-Type: application/json" \
274-
-d "{\"image\": \"data:image/png;base64,$TEST_IMAGE_B64\", \"prompt\": \"What text do you see in this image?\", \"max_tokens\": 200}" \
275-
> vision-result.json 2>&1 || true
279+
# Note: /api/vision endpoint not yet implemented
280+
# Vision processing is available via the vision feature flag but
281+
# the HTTP API endpoint hasn't been added to server.rs yet
282+
echo "Note: /api/vision endpoint not yet implemented in server"
283+
echo "Vision feature is compiled in, but API endpoint pending"
276284
277-
echo "Vision API Result:"
278-
cat vision-result.json
279-
280-
# Check result
281-
if [ -s vision-result.json ] && grep -q "error\|text\|content" vision-result.json; then
282-
echo "✅ Vision API responded"
283-
VISION_SUCCESS="true"
284-
else
285-
echo "⚠️ Vision API test inconclusive"
286-
VISION_SUCCESS="false"
287-
fi
288-
289-
# Save for test results
290-
echo "$VISION_SUCCESS" > vision-test-status.txt
285+
# Save server status for results
286+
echo "$SERVER_READY" > server-test-status.txt
291287
292288
# Cleanup
293289
kill $SERVER_PID 2>/dev/null || true
294290
295291
- name: Generate test results
296292
run: |
297-
VISION_SUCCESS=$(cat vision-test-status.txt 2>/dev/null || echo "false")
293+
SERVER_SUCCESS=$(cat server-test-status.txt 2>/dev/null || echo "false")
298294
299295
cat > test-results-linux-x86_64.json << EOF
300296
{
301297
"platform": "linux-x86_64",
302-
"vision_enabled": true,
298+
"vision_feature_compiled": true,
303299
"model_cached": ${{ steps.cache-model.outputs.cache-hit == 'true' }},
304300
"tests": {
305301
"binary_loads": true,
306302
"help_works": true,
307-
"vision_api_test": $VISION_SUCCESS
303+
"server_starts": $SERVER_SUCCESS,
304+
"vision_api_endpoint": "not_implemented"
308305
},
306+
"notes": "Vision feature compiled but /api/vision endpoint pending",
309307
"timestamp": "${{ github.run_id }}"
310308
}
311309
EOF
@@ -369,7 +367,7 @@ jobs:
369367
./bin/shimmy.exe --help || echo "Help completed"
370368
echo "✅ Help displayed"
371369
372-
- name: Test 3 - Start server and test Vision API
370+
- name: Test 3 - Start server and test endpoints
373371
shell: bash
374372
run: |
375373
# Start server in background
@@ -378,57 +376,56 @@ jobs:
378376
echo "Server started with PID $SERVER_PID"
379377
380378
# Wait for server to be ready
379+
SERVER_READY="false"
381380
for i in {1..30}; do
382381
if curl -s http://127.0.0.1:11435/health > /dev/null 2>&1; then
383382
echo "Server is ready"
383+
SERVER_READY="true"
384384
break
385385
fi
386386
echo "Waiting for server... ($i/30)"
387387
sleep 2
388388
done
389389
390-
# Download a test image
391-
curl -L -o test-ocr.png "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4f/SVG_Logo.svg/320px-SVG_Logo.svg.png"
390+
# Test health endpoint
391+
echo "Testing health endpoint..."
392+
curl -s http://127.0.0.1:11435/health > health-result.json || true
393+
echo "Health check result:"
394+
cat health-result.json
392395
393-
# Convert image to base64 (Windows compatible)
394-
TEST_IMAGE_B64=$(base64 -w 0 test-ocr.png 2>/dev/null || base64 test-ocr.png | tr -d '\n')
396+
# Test models endpoint (OpenAI compatible)
397+
echo "Testing models endpoint..."
398+
curl -s http://127.0.0.1:11435/v1/models > models-result.json || true
399+
echo "Models result:"
400+
cat models-result.json
395401
396-
echo "Running Vision API test..."
397-
curl -s -X POST http://127.0.0.1:11435/api/vision \
398-
-H "Content-Type: application/json" \
399-
-d "{\"image\": \"data:image/png;base64,$TEST_IMAGE_B64\", \"prompt\": \"What text do you see in this image?\", \"max_tokens\": 200}" \
400-
> vision-result.json 2>&1 || true
402+
# Note: /api/vision endpoint not yet implemented
403+
echo "Note: /api/vision endpoint not yet implemented in server"
404+
echo "Vision feature is compiled in, but API endpoint pending"
401405
402-
echo "Vision API Result:"
403-
cat vision-result.json
404-
405-
# Check result
406-
if [ -s vision-result.json ] && grep -q "error\|text\|content" vision-result.json; then
407-
echo "✅ Vision API responded"
408-
echo "true" > vision-test-status.txt
409-
else
410-
echo "⚠️ Vision API test inconclusive"
411-
echo "false" > vision-test-status.txt
412-
fi
406+
# Save server status for results
407+
echo "$SERVER_READY" > server-test-status.txt
413408
414409
# Cleanup - taskkill for Windows
415410
taskkill //F //PID $SERVER_PID 2>/dev/null || kill $SERVER_PID 2>/dev/null || true
416411
417412
- name: Generate test results
418413
shell: bash
419414
run: |
420-
VISION_SUCCESS=$(cat vision-test-status.txt 2>/dev/null || echo "false")
415+
SERVER_SUCCESS=$(cat server-test-status.txt 2>/dev/null || echo "false")
421416
422417
cat > test-results-windows-x86_64.json << EOF
423418
{
424419
"platform": "windows-x86_64",
425-
"vision_enabled": true,
420+
"vision_feature_compiled": true,
426421
"model_cached": ${{ steps.cache-model.outputs.cache-hit == 'true' }},
427422
"tests": {
428423
"binary_loads": true,
429424
"help_works": true,
430-
"vision_api_test": $VISION_SUCCESS
425+
"server_starts": $SERVER_SUCCESS,
426+
"vision_api_endpoint": "not_implemented"
431427
},
428+
"notes": "Vision feature compiled but /api/vision endpoint pending",
432429
"timestamp": "${{ github.run_id }}"
433430
}
434431
EOF
@@ -460,19 +457,21 @@ jobs:
460457
run: |
461458
echo "# 👁️ Vision Cross-Platform Test Summary" >> $GITHUB_STEP_SUMMARY
462459
echo "" >> $GITHUB_STEP_SUMMARY
463-
echo "| Platform | Vision Enabled | Model Cached | Vision API Test |" >> $GITHUB_STEP_SUMMARY
464-
echo "|----------|----------------|--------------|-----------------|" >> $GITHUB_STEP_SUMMARY
460+
echo "| Platform | Vision Compiled | Server Starts | Vision API |" >> $GITHUB_STEP_SUMMARY
461+
echo "|----------|-----------------|---------------|------------|" >> $GITHUB_STEP_SUMMARY
465462
466463
for file in ./results/*/test-results-*.json; do
467464
if [ -f "$file" ]; then
468465
platform=$(jq -r '.platform' "$file")
469-
vision=$(jq -r '.vision_enabled' "$file")
470-
cached=$(jq -r '.model_cached // "N/A"' "$file")
471-
vision_api=$(jq -r '.tests.vision_api_test // "N/A"' "$file")
472-
echo "| $platform | $vision | $cached | $vision_api |" >> $GITHUB_STEP_SUMMARY
466+
vision=$(jq -r '.vision_feature_compiled // .vision_enabled // "N/A"' "$file")
467+
server=$(jq -r '.tests.server_starts // "N/A"' "$file")
468+
vision_api=$(jq -r '.tests.vision_api_endpoint // .tests.vision_api_test // "N/A"' "$file")
469+
echo "| $platform | $vision | $server | $vision_api |" >> $GITHUB_STEP_SUMMARY
473470
fi
474471
done
475472
473+
echo "" >> $GITHUB_STEP_SUMMARY
474+
echo "**Note**: Vision feature is compiled into binaries but the /api/vision HTTP endpoint is not yet implemented." >> $GITHUB_STEP_SUMMARY
476475
echo "" >> $GITHUB_STEP_SUMMARY
477476
echo "Run ID: ${{ github.run_id }}" >> $GITHUB_STEP_SUMMARY
478477

0 commit comments

Comments
 (0)