-
Notifications
You must be signed in to change notification settings - Fork 0
248 lines (233 loc) · 8.02 KB
/
verify.yml
File metadata and controls
248 lines (233 loc) · 8.02 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
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('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Create test directories
run: |
mkdir -p tests/data
mkdir -p test_chroma_db
- name: Run unit tests only
run: |
python -m pytest -n auto tests/ -m "unit or fast" --ignore=tests/integration -v --tb=short --cov=app --cov=reasoning_engine --cov=document_processor --cov=utils --cov=task_manager --cov=task_ui --cov=tasks --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: |
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
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('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Create test directories
run: |
mkdir -p tests/data
mkdir -p test_chroma_db
mkdir -p tests/e2e/fixtures
- name: Generate test fixtures
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, e2e-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('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Setup test environment
run: |
mkdir -p tests/data
mkdir -p test_chroma_db
python scripts/generate_assets.py || echo "Test assets generation failed, continuing..."
- name: Run integration tests
run: |
python -m 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: |
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('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- 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: |
# Parallelize for speed
python -m pytest -n auto tests/ -m "performance" -v --tb=short || python scripts/test_performance_regression.py
- 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: |
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