Skip to content

Runtime Tests

Runtime Tests #80

Workflow file for this run

name: Runtime Tests
on:
workflow_dispatch:
inputs:
test_id:
description: "Run a single test by ID (e.g. TC-RUNTIME-001)"
required: false
type: string
debug:
description: "Enable OLLAMA_DEBUG=1 in container"
required: false
default: false
type: boolean
graph_safety_multiplier:
description: "Override OLLAMA_GRAPH_SAFETY_MULTIPLIER (#352 graph-buffer margin). Empty = built-in 2.5"
required: false
type: string
runner_label:
description: "Which GPU testbed to run on. sm37 = Tesla K80 (reference). sm75 = RTX 2060."
required: false
default: "sm37"
type: choice
options:
- "sm37"
- "sm75"
workflow_call:
inputs:
debug:
description: "Enable OLLAMA_DEBUG=1 in container"
required: false
default: false
type: boolean
runner_label:
description: "Which GPU testbed to run on"
required: false
default: "sm37"
type: string
outputs:
result:
description: "Runtime test result"
value: ${{ jobs.runtime.outputs.result }}
jobs:
runtime:
name: Container & Runtime Tests
# Defaults to sm37 (Tesla K80, the reference testbed). Never a bare `self-hosted`:
# a K80 sweep landing on a small consumer card produces numbers that look valid.
runs-on: [self-hosted, "${{ inputs.runner_label || 'sm37' }}"]
environment: cicd-1
env:
OLLAMA37_ROOT: ${{ github.workspace }}
OLLAMA_DEBUG: ${{ inputs.debug && '1' || '' }}
OLLAMA_GRAPH_SAFETY_MULTIPLIER: ${{ inputs.graph_safety_multiplier }}
outputs:
result: ${{ steps.runtime-tests.outcome }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Identify host
uses: ./.github/actions/identify-host
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install test runner dependencies
run: cd cicd/tests && npm ci
- name: Run runtime tests
id: runtime-tests
run: |
cd cicd/tests
# Build test ID flag if provided
ID_FLAG=""
if [ -n "${{ inputs.test_id }}" ]; then
ID_FLAG="--id ${{ inputs.test_id }}"
echo "Running single test: ${{ inputs.test_id }}"
fi
rc=0
bash ../scripts/gpu-temp-guard.sh -- npx tsx src/cli.ts run --suite runtime $ID_FLAG --format json > /tmp/runtime-results.json || rc=$?
[ "$rc" -eq 75 ] && exit 1 # overheat → fail the job; any other non-zero stays tolerated (gated by the JSON below)
echo "--- JSON Results ---"
cat /tmp/runtime-results.json
- name: Check test results
run: |
FAILED=$(jq '.summary.failed' /tmp/runtime-results.json)
echo "Failed tests: $FAILED"
if [ "$FAILED" -gt 0 ]; then
echo "::error::$FAILED runtime test(s) failed"
exit 1
fi
- name: Upload runtime results
uses: actions/upload-artifact@v4
if: always()
with:
name: runtime-test-results
path: |
/tmp/runtime-results.json
cicd/results/