-
Notifications
You must be signed in to change notification settings - Fork 266
86 lines (69 loc) · 2.28 KB
/
test.yml
File metadata and controls
86 lines (69 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Run Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip packages
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r tests/requirements.txt
- name: Run unit tests
run: |
# Run quick CI tests
python tests/test_ci_quick.py
# Run plugin tests with pytest if available
python -m pytest tests/test_plugins.py -v --tb=short || python tests/test_plugins.py
# Run approach tests
python tests/test_approaches.py
integration-test:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
# Only run integration tests on PRs from the same repository (not forks)
# This ensures secrets are available
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run integration test with OpenAI
if: env.OPENAI_API_KEY != ''
run: |
# Start OptILLM server
python optillm.py &
SERVER_PID=$!
# Wait for server
sleep 5
# Run simple integration test
python tests/test.py --approaches none --single-test "Simple Math Problem" --base-url http://localhost:8000/v1 --model gpt-4o-mini || true
# Stop server
kill $SERVER_PID || true
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
continue-on-error: true