Skip to content

V0.12.1 (#106)

V0.12.1 (#106) #28

Workflow file for this run

# Copyright(C) 2024-2025 Advanced Micro Devices, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
# This workflow runs tests for the evaluation tool
# Triggers when eval source code or tests are modified
# Platform: Windows only
name: Test Evaluation Tool
on:
workflow_call:
push:
branches: ["main"]
paths:
- "src/gaia/eval/**"
- "src/gaia/eval/configs/**"
- "src/gaia/eval/webapp/**"
- "tests/test_eval*.py"
- "groundtruth/**"
- "test_data/**"
pull_request:
branches: ["main"]
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "src/gaia/eval/**"
- "src/gaia/eval/configs/**"
- "src/gaia/eval/webapp/**"
- "tests/test_eval*.py"
- "groundtruth/**"
- "test_data/**"
workflow_dispatch:
permissions:
contents: read
jobs:
test-eval-windows:
name: Test Eval Tool (Windows)
runs-on: windows-latest
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')
timeout-minutes: 10 # 2 minute target but allow some buffer
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install pytest pytest-cov pytest-mock
pip install anthropic rich
- name: Run eval unit tests
run: |
pytest tests/test_eval.py -v --cov=src/gaia/eval --cov-report=term-missing
- name: Test eval CLI commands
run: |
# Test help command
python -m gaia.cli eval --help
# Test visualize help
python -m gaia.cli visualize --help
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Test webapp functionality
run: |
cd src/gaia/eval/webapp
# Install dependencies
npm install
# Run syntax checks
npm test
# Test that server can start (Windows-compatible version)
$env:PORT = 3456 # Use non-default port to avoid conflicts
$process = Start-Process node -ArgumentList "server.js" -PassThru -ErrorAction Stop
Start-Sleep -Seconds 3
if ($process.HasExited) {
Write-Error "Server failed to start or crashed immediately"
exit 1
}
# Try to connect to the server
try {
$response = Invoke-WebRequest -Uri "http://localhost:3456" -TimeoutSec 5 -UseBasicParsing
Write-Output "Server responded with status: $($response.StatusCode)"
} catch {
Write-Error "Server did not respond to HTTP request"
Stop-Process -Id $process.Id -Force -ErrorAction SilentlyContinue
exit 1
}
Stop-Process -Id $process.Id -Force
Write-Output "Webapp server test passed"