-
Notifications
You must be signed in to change notification settings - Fork 0
327 lines (310 loc) · 10.7 KB
/
verify.yml
File metadata and controls
327 lines (310 loc) · 10.7 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
name: verifyExpected
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Create test directories
run: |
mkdir -p tests/data
mkdir -p test_chroma_db
- name: Run unit tests only
run: |
poetry run pytest -n auto tests/ -m "unit or fast" --ignore=tests/integration -v --tb=short --cov=basicchat --cov-report=term-missing --cov-report=html:htmlcov
env:
ENABLE_BACKGROUND_TASKS: "true"
REDIS_ENABLED: "false"
CELERY_BROKER_URL: "redis://localhost:6379/0"
MOCK_EXTERNAL_SERVICES: "true"
TESTING: "true"
CHROMA_PERSIST_DIR: "./test_chroma_db"
- name: Upload coverage reports
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: htmlcov/
retention-days: 30
- name: Generate Final Test Report
run: |
poetry run python scripts/generate_final_report.py || true
- name: Upload Final Test Report
uses: actions/upload-artifact@v4
with:
name: final-test-report-unit-tests-${{ github.run_id }}
path: final_test_report.md
retention-days: 30
e2e-tests:
runs-on: ubuntu-latest
needs: unit-tests
if: false # Temporarily disable E2E tests - they require full server setup
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install Playwright
run: |
npm ci
npx playwright install --with-deps
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Create test directories
run: |
mkdir -p tests/data
mkdir -p test_chroma_db
mkdir -p tests/e2e/fixtures
- name: Generate test fixtures
run: |
poetry run python scripts/generate_test_assets.py || echo "Test assets generation failed, continuing..."
- name: Run E2E tests
run: |
npx playwright test --reporter=html,json,junit
env:
MOCK_EXTERNAL_SERVICES: "true"
CHROMA_PERSIST_DIR: "./test_chroma_db"
ENABLE_BACKGROUND_TASKS: "true"
REDIS_ENABLED: "false"
CELERY_BROKER_URL: "redis://localhost:6379/0"
TESTING: "true"
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: |
test-results.json
test-results.xml
retention-days: 30
integration-tests:
runs-on: ubuntu-latest
if: |
github.ref == 'refs/heads/main' ||
contains(github.event.head_commit.message, '[run-integration]') ||
contains(github.event.pull_request.title, '[run-integration]')
needs: [unit-tests]
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Setup test environment
run: |
mkdir -p tests/data
mkdir -p test_chroma_db
poetry run python scripts/generate_assets.py || echo "Test assets generation failed, continuing..."
- name: Run integration tests
run: |
poetry run pytest -n auto tests/ -m "integration" -v --tb=short --timeout=300
env:
MOCK_EXTERNAL_SERVICES: "true"
CHROMA_PERSIST_DIR: "./test_chroma_db"
ENABLE_BACKGROUND_TASKS: "true"
REDIS_ENABLED: "false"
CELERY_BROKER_URL: "redis://localhost:6379/0"
TESTING: "true"
- name: Cleanup test environment
if: always()
run: |
rm -rf ./test_chroma_db
rm -rf temp_*.mp3
rm -rf tests/data/test_*
- name: Generate Final Test Report
run: |
poetry run python scripts/generate_final_report.py || true
- name: Upload Final Test Report
uses: actions/upload-artifact@v4
with:
name: final-test-report-integration-tests-${{ github.run_id }}
path: final_test_report.md
retention-days: 30
performance-regression:
runs-on: ubuntu-latest
if: |
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Run Performance Regression Test
env:
PERF_TIME_THRESHOLD: "30.0"
# Default memory threshold set to 600MB for LLM evaluation workloads
PERF_MEM_THRESHOLD: "600.0"
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_MODEL: ${{ vars.OPENAI_MODEL || 'gpt-3.5-turbo' }}
run: |
# Run performance regression test directly
echo "Running performance regression test..."
poetry run python scripts/test_performance_regression.py
# Verify the test output
if [ $? -eq 0 ]; then
echo "✅ Performance regression test completed successfully"
else
echo "❌ Performance regression test failed"
exit 1
fi
- name: Upload Performance Metrics
if: always()
uses: actions/upload-artifact@v4
with:
name: performance-metrics
path: performance_metrics.json
retention-days: 30
- name: Generate Final Test Report
run: |
poetry run python scripts/generate_final_report.py || true
- name: Check Final Test Report Exists
run: |
if [ ! -f final_test_report.md ]; then
echo "❌ final_test_report.md not found! Report generation failed."
exit 1
fi
- name: Print Final Test Report (for debugging)
run: cat final_test_report.md
- name: Upload Final Test Report
uses: actions/upload-artifact@v4
with:
name: final-test-report-performance-regression-${{ github.run_id }}
path: final_test_report.md
retention-days: 30
llm-judge:
runs-on: ubuntu-latest
needs: unit-tests
if: |
github.event_name == 'push' ||
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Setup test environment
run: |
mkdir -p tests/data
mkdir -p test_chroma_db
poetry run python scripts/generate_test_assets.py || echo "Test assets generation failed, continuing..."
- name: Run LLM Judge Evaluation (Smart Backend)
env:
LLM_JUDGE_THRESHOLD: "7.0"
LLM_JUDGE_FORCE_BACKEND: "OPENAI"
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_MODEL: ${{ vars.OPENAI_MODEL || 'gpt-3.5-turbo' }}
MOCK_EXTERNAL_SERVICES: "true"
CHROMA_PERSIST_DIR: "./test_chroma_db"
TESTING: "true"
run: |
echo "🤖 Starting Smart LLM Judge evaluation..."
poetry run python basicchat/evaluation/evaluators/check_llm_judge_smart.py --quick
- name: Generate Actionable Report
if: always()
run: |
poetry run python scripts/generate_llm_judge_report.py || echo "Report generation failed"
- name: Upload LLM Judge Results
if: always()
uses: actions/upload-artifact@v4
with:
name: llm-judge-results
path: |
llm_judge_results.json
llm_judge_action_items.md
llm_judge_improvement_tips.md
retention-days: 30
- name: Generate Final Test Report
run: |
poetry run python scripts/generate_final_report.py || true
- name: Upload Final Test Report
uses: actions/upload-artifact@v4
with:
name: final-test-report-llm-judge-${{ github.run_id }}
path: final_test_report.md
retention-days: 30