-
Notifications
You must be signed in to change notification settings - Fork 0
179 lines (149 loc) · 4.7 KB
/
Copy pathtests.yml
File metadata and controls
179 lines (149 loc) · 4.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
name: Tests
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
permissions:
contents: read
env:
UV_CACHE_DIR: .uv-cache
jobs:
dependency-check:
name: Dependency and lockfile check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
version: "latest"
- name: Restore uv cache
uses: actions/cache@v4
with:
path: .uv-cache
key: uv-${{ runner.os }}-3.11-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-3.11-
- name: Verify lockfile is current
run: uv lock --check
- name: Verify test environment resolves from lockfile
run: uv sync --frozen --extra server --extra client-static --extra test
fast-tests:
name: Fast unit and resilience tests
runs-on: ubuntu-latest
needs: dependency-check
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
version: "latest"
- name: Restore uv cache
uses: actions/cache@v4
with:
path: .uv-cache
key: uv-${{ runner.os }}-3.11-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-3.11-
- name: Install dependencies
run: uv sync --frozen --extra server --extra client-static --extra test
- name: Check generated artifacts
run: uv run python scripts/check_repository_artifacts.py --changed
- name: Run fast tests
run: |
mkdir -p reports
uv run pytest \
tests/unit \
tests/integration/test_client_resilience.py \
tests/integration/test_client_lifecycle.py \
tests/integration/test_variance_and_local_inference.py \
tests/test_mqtt_client \
tests/test_offloading_algo \
-v \
--cov=client \
--cov=server \
--cov-report=term-missing \
--cov-report=xml:coverage-fast.xml \
--junitxml=reports/fast-tests.xml
- name: Generate report-only benchmark
run: |
mkdir -p reports
uv run python scripts/benchmark_report.py \
--iterations 50 \
--warmups 1 \
--output reports/benchmark-report.json
- name: Upload fast test report
uses: actions/upload-artifact@v4
if: always()
with:
name: fast-test-report
path: |
reports/fast-tests.xml
reports/benchmark-report.json
coverage-fast.xml
- name: Upload fast coverage
uses: codecov/codecov-action@v3
with:
files: ./coverage-fast.xml
flags: fast-tests
name: fast-tests
fail_ci_if_error: false
http-integration:
name: HTTP integration tests
runs-on: ubuntu-latest
needs: dependency-check
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
version: "latest"
- name: Restore uv cache
uses: actions/cache@v4
with:
path: .uv-cache
key: uv-${{ runner.os }}-3.11-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-3.11-
- name: Install dependencies
run: uv sync --frozen --extra server --extra client-static --extra test
- name: Run HTTP integration tests
run: |
mkdir -p reports
uv run pytest \
tests/integration/test_http_end_to_end.py \
tests/integration/test_http_protocol_validation.py \
-v \
--cov=client \
--cov=server \
--cov-report=term-missing \
--cov-report=xml:coverage-http.xml \
--junitxml=reports/http-integration.xml
- name: Upload HTTP integration report
uses: actions/upload-artifact@v4
if: always()
with:
name: http-integration-report
path: |
reports/http-integration.xml
coverage-http.xml
- name: Upload HTTP integration coverage
uses: codecov/codecov-action@v3
with:
files: ./coverage-http.xml
flags: http-integration
name: http-integration
fail_ci_if_error: false