Repository navigation
173 lines (173 loc) · 6.64 KB
/
Copy pathpython-tests.yaml
File metadata and controls
173 lines (173 loc) · 6.64 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
name: Python tests
on:
workflow_call:
# Two sequential Rest runners keep each shard below its timeout.
# Shard 1 includes variables; shard 2 also supplies the legacy summary check.
# Only the guarded PR workflow calls this file; it has no automatic triggers.
jobs:
RestPython:
name: Full Suite - Rest (Python, shard-1 + variables)
runs-on: ubuntu-latest
# Historical group times, including variables: 33-46 minutes plus setup.
timeout-minutes: 90
env:
PYTHONUNBUFFERED: 1
OMP_NUM_THREADS: 4
OPENBLAS_NUM_THREADS: 4
MKL_NUM_THREADS: 4
VECLIB_MAXIMUM_THREADS: 4
NUMEXPR_NUM_THREADS: 4
OMP_WAIT_POLICY: PASSIVE
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.14
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
with:
version: "0.12.13"
- name: Resolve latest compatible PolicyEngine Core
run: uv lock --upgrade-package policyengine-core
- name: Install dependencies
run: uv sync --locked --extra dev
- name: Turn off default branching
shell: bash
run: bash ./update_itemization.sh
# Each group remains a separate, sequential process on its runner.
# SPM simulation/API contracts stay in the Microsimulation job.
- name: Run remaining Python tests
if: ${{ !cancelled() }}
env:
PYTEST_ADDOPTS: "--durations=0 -v -p no:unraisableexception -p no:threadexception"
run: uv run --no-sync make test-other-python-rest REST_PYTHON_SHARD=1 REST_REPORT_DIR=.
- name: Upload Rest Python timing and memory reports
if: always()
uses: actions/upload-artifact@v4
with:
name: rest-python-test-timings-shard-1
path: |
rest-python-*.xml
rest-python-*-resources.txt
- name: Run tests/variables YAML tests
if: ${{ !cancelled() }}
env:
PYTEST_ADDOPTS: "--durations=0 --junitxml=rest-variables.xml -p no:unraisableexception -p no:threadexception"
run: /usr/bin/time -v -o rest-variables-resources.txt uv run --no-sync make test-yaml-variables
- name: Upload Rest variables timing and memory reports
if: always()
uses: actions/upload-artifact@v4
with:
name: rest-variables-test-timings
path: |
rest-variables.xml
rest-variables-resources.txt
Rest:
needs: [RestPython]
if: ${{ always() }}
name: Full Suite - Rest (Python + variables)
runs-on: ubuntu-latest
# Historical group times: 32-46 minutes plus setup.
# This runner also retains the legacy summary check, keeping PRs at 27 runners.
timeout-minutes: 90
env:
PYTHONUNBUFFERED: 1
OMP_NUM_THREADS: 4
OPENBLAS_NUM_THREADS: 4
MKL_NUM_THREADS: 4
VECLIB_MAXIMUM_THREADS: 4
NUMEXPR_NUM_THREADS: 4
OMP_WAIT_POLICY: PASSIVE
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.14
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
with:
version: "0.12.13"
- name: Resolve latest compatible PolicyEngine Core
run: uv lock --upgrade-package policyengine-core
- name: Install dependencies
run: uv sync --locked --extra dev
- name: Turn off default branching
shell: bash
run: bash ./update_itemization.sh
# Each group remains a separate, sequential process on its runner.
# SPM simulation/API contracts stay in the Microsimulation job.
- name: Run remaining Python tests
id: python_tests
if: ${{ !cancelled() }}
env:
PYTEST_ADDOPTS: "--durations=0 -v -p no:unraisableexception -p no:threadexception"
run: uv run --no-sync make test-other-python-rest REST_PYTHON_SHARD=2 REST_REPORT_DIR=.
- name: Upload Rest Python timing and memory reports
if: always()
uses: actions/upload-artifact@v4
with:
name: rest-python-test-timings-shard-2
path: |
rest-python-*.xml
rest-python-*-resources.txt
- name: Check all Rest jobs succeeded
if: always()
shell: bash
env:
PYTHON_RESULT: ${{ needs.RestPython.result }}
SHARD_RESULT: ${{ steps.python_tests.outcome }}
run: |
if [[ "$PYTHON_RESULT" != "success" || "$SHARD_RESULT" != "success" ]]; then
echo "::error::Rest shards did not all succeed: shard-1=$PYTHON_RESULT, shard-2=$SHARD_RESULT"
exit 1
fi
Microsimulation:
name: Full Suite - Microsimulation
runs-on: ubuntu-latest
timeout-minutes: 60
env:
PYTHONUNBUFFERED: 1
PYTEST_ADDOPTS: "--durations=25 -p no:unraisableexception -p no:threadexception"
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.14
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
with:
version: "0.12.13"
- name: Resolve latest compatible PolicyEngine Core
run: uv lock --upgrade-package policyengine-core
- name: Install dependencies
run: uv sync --locked --extra dev
- name: Turn off default branching
shell: bash
run: bash ./update_itemization.sh
# Keep simulation/API and dataset compatibility on this existing runner.
# Use separate, sequential processes: combining these suites in one
# pytest process previously accumulated enough memory to kill the runner.
- name: Run SPM Python tests
env:
PYTEST_ADDOPTS: "--durations=0 -v --junitxml=simulation-spm.xml -p no:unraisableexception -p no:threadexception"
run: /usr/bin/time -v -o simulation-spm-resources.txt uv run --no-sync make test-other-python-spm
- name: Run microsimulation tests
# Continue after failures, but stop when the workflow is cancelled.
if: ${{ !cancelled() }}
env:
PYTEST_ADDOPTS: "--durations=0 -v --junitxml=simulation-microsimulation.xml -p no:unraisableexception -p no:threadexception"
run: /usr/bin/time -v -o simulation-microsimulation-resources.txt uv run --no-sync make test-microsimulation
- name: Upload simulation timing and memory reports
if: always()
uses: actions/upload-artifact@v4
with:
name: simulation-test-timings
path: |
simulation-*.xml
simulation-*-resources.txt