-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (151 loc) · 4.94 KB
/
test.yml
File metadata and controls
177 lines (151 loc) · 4.94 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: Test
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Set minimal required permissions
permissions:
contents: read
jobs:
test-python:
name: Python Unit Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12', '3.13']
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-asyncio pytest-cov
# Install OctoLLM dependencies (Phase 1+)
# pip install -r services/orchestrator/requirements.txt
- name: Run pytest with coverage
run: |
echo "Running Python unit tests..."
pytest tests/unit/ -v --cov=services --cov-report=xml --cov-report=term-missing || echo "No tests found yet (Phase 0)"
continue-on-error: true # Don't fail if no tests exist
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: matrix.python-version == '3.13' # Only upload once
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
name: python-unit-tests
fail_ci_if_error: false
test-rust:
name: Rust Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
services/reflex-layer/target
services/arms/executor/target
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-test-
- name: Run cargo test - Reflex Layer
working-directory: services/reflex-layer
run: |
echo "Running Rust unit tests for Reflex Layer..."
cargo test --verbose || echo "No tests found yet (Phase 0)"
continue-on-error: true
- name: Run cargo test - Executor Arm
working-directory: services/arms/executor
run: |
echo "Running Rust unit tests for Executor Arm..."
cargo test --verbose || echo "No tests found yet (Phase 0)"
continue-on-error: true
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17.7-alpine
env:
POSTGRES_USER: octollm
POSTGRES_PASSWORD: octollm_dev_pass
POSTGRES_DB: octollm
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:8-alpine
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: 'pip'
- name: Install dependencies
run: |
pip install pytest pytest-asyncio httpx asyncpg redis
- name: Wait for services to be ready
run: |
echo "Waiting for PostgreSQL..."
for i in {1..30}; do
pg_isready -h localhost -p 5432 -U octollm && break
echo "Waiting for PostgreSQL to be ready... ($i/30)"
sleep 2
done
echo "Waiting for Redis..."
for i in {1..30}; do
redis-cli -h localhost -p 6379 ping && break
echo "Waiting for Redis to be ready... ($i/30)"
sleep 2
done
- name: Run integration tests
env:
DATABASE_URL: postgresql://octollm:octollm_dev_pass@localhost:5432/octollm
REDIS_URL: redis://localhost:6379
run: |
echo "Running integration tests..."
pytest tests/integration/ -v || echo "No integration tests found yet (Phase 0)"
continue-on-error: true
test-summary:
name: Test Summary
runs-on: ubuntu-latest
needs: [test-python, test-rust, integration-tests]
if: always()
steps:
- name: Check test results
run: |
echo "✅ Test workflow complete"
echo "Phase 0: No tests exist yet - this is expected"
echo "Tests will be added in Phase 1 (Proof of Concept)"