21
21
RELEASE_TAG : latest
22
22
23
23
jobs :
24
- build :
25
- name : " Build Firedrake"
26
- # Run on our self-hosted machines
24
+ test :
25
+ name : " Run Firedrake tests (Linux)"
27
26
runs-on : [self-hosted, Linux]
28
27
container :
29
28
image : firedrakeproject/firedrake-env:latest
30
29
strategy :
31
- # Don't immediately kill real if complex fails and vice versa.
30
+ # We want to know all of the tests which fail, so don't kill real if
31
+ # complex fails and vice-versa
32
32
fail-fast : false
33
33
matrix :
34
34
include :
@@ -47,13 +47,16 @@ jobs:
47
47
OPENBLAS_NUM_THREADS : 1
48
48
COMPLEX : ${{ matrix.complex }}
49
49
RDMAV_FORK_SAFE : 1
50
+ EXTRA_PYTEST_ARGS : --splitting-algorithm least_duration --timeout=1800 --timeout-method=thread -o faulthandler_timeout=1860 tests/firedrake
50
51
steps :
51
52
- uses : actions/checkout@v4
53
+
52
54
- name : Cleanup
53
55
if : ${{ always() }}
54
56
run : |
55
57
cd ..
56
58
rm -rf firedrake_venv
59
+
57
60
- name : Build Firedrake
58
61
run : |
59
62
cd ..
@@ -85,58 +88,105 @@ jobs:
85
88
--install gadopt \
86
89
--install asQ \
87
90
|| (cat firedrake-install.log && /bin/false)
91
+
88
92
- name : Install test dependencies
93
+ id : build
89
94
run : |
95
+ sudo apt update
96
+ sudo apt -y install parallel
90
97
. ../firedrake_venv/bin/activate
91
98
python "$(which firedrake-clean)"
92
- python -m pip install \
93
- pytest-xdist pytest-timeout ipympl
99
+ python -m pip install pytest-timeout ipympl pytest-split
94
100
python -m pip list
95
- - name : Test Firedrake
101
+
102
+ - name : Run tests (nprocs = 1)
96
103
run : |
97
104
. ../firedrake_venv/bin/activate
98
- echo OMP_NUM_THREADS is "$OMP_NUM_THREADS"
99
- echo OPENBLAS_NUM_THREADS is "$OPENBLAS_NUM_THREADS"
100
- python -m pytest -v tests/firedrake/test_0init.py
101
- python -m pytest \
102
- --durations=200 \
103
- --timeout=1800 \
104
- --timeout-method=thread \
105
- -o faulthandler_timeout=1860 \
106
- -n 12 --dist worksteal \
107
- --junit-xml=firedrake.xml \
108
- -sv tests/firedrake
109
- timeout-minutes : 120
105
+ firedrake-run-split-tests 1 12 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake1_{#}.xml"
106
+
107
+ - name : Run tests (nprocs = 2)
108
+ # Run even if earlier tests failed
109
+ if : ${{ success() || steps.build.conclusion == 'success' }}
110
+ run : |
111
+ . ../firedrake_venv/bin/activate
112
+ firedrake-run-split-tests 2 6 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake2_{#}.xml"
113
+
114
+ - name : Run tests (nprocs = 3)
115
+ if : ${{ success() || steps.build.conclusion == 'success' }}
116
+ run : |
117
+ . ../firedrake_venv/bin/activate
118
+ firedrake-run-split-tests 3 4 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake3_{#}.xml"
119
+
120
+ - name : Run tests (nprocs = 4)
121
+ if : ${{ success() || steps.build.conclusion == 'success' }}
122
+ run : |
123
+ . ../firedrake_venv/bin/activate
124
+ firedrake-run-split-tests 4 3 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake4_{#}.xml"
125
+
126
+ - name : Run tests (nprocs = 5)
127
+ if : ${{ success() || steps.build.conclusion == 'success' }}
128
+ run : |
129
+ . ../firedrake_venv/bin/activate
130
+ firedrake-run-split-tests 5 2 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake5_{#}.xml"
131
+
132
+ - name : Run tests (nprocs = 6)
133
+ if : ${{ success() || steps.build.conclusion == 'success' }}
134
+ run : |
135
+ . ../firedrake_venv/bin/activate
136
+ firedrake-run-split-tests 6 2 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake6_{#}.xml"
137
+
138
+ - name : Run tests (nprocs = 7)
139
+ if : ${{ success() || steps.build.conclusion == 'success' }}
140
+ run : |
141
+ . ../firedrake_venv/bin/activate
142
+ firedrake-run-split-tests 7 1 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake7_{#}.xml"
143
+
144
+ - name : Run tests (nprocs = 8)
145
+ if : ${{ success() || steps.build.conclusion == 'success' }}
146
+ run : |
147
+ . ../firedrake_venv/bin/activate
148
+ firedrake-run-split-tests 8 1 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake8_{#}.xml"
149
+
110
150
- name : Publish Test Report
111
151
uses : mikepenz/action-junit-report@v5.0.0-a02
112
152
# To avoid permissions issues do not run with forked repos
113
153
# (see https://github.com/mikepenz/action-junit-report/issues/23)
114
154
if : ${{ always() && (github.ref != 'refs/heads/master') && (github.event.pull_request.head.repo.full_name == github.repository) }}
115
155
with :
116
- report_paths : ' /__w/ firedrake/firedrake/firedrake .xml'
156
+ report_paths : ' firedrake* .xml'
117
157
comment : true
118
158
check_name : " Firedrake ${{ matrix.scalar-type }}"
119
159
updateComment : true
120
160
flaky_summary : true
161
+
162
+ - name : Upload log files
163
+ uses : actions/upload-artifact@v4
164
+ with :
165
+ name : firedrake-logs-${{ matrix.scalar-type }}
166
+ path : pytest_*.log
167
+
121
168
- name : Test pyadjoint
122
169
if : ${{ matrix.scalar-type == 'real' }}
123
170
run : |
124
171
. ../firedrake_venv/bin/activate
125
172
cd ../firedrake_venv/src/pyadjoint
126
173
python -m pytest \
174
+ --strict-markers \
127
175
--durations=200 \
128
176
--timeout=600 \
129
177
--timeout-method=thread \
130
178
-o faulthandler_timeout=660 \
131
179
-n 12 --dist worksteal \
132
180
-sv tests/firedrake_adjoint
133
181
timeout-minutes : 30
182
+
134
183
- name : Cleanup
135
184
# Belt and braces: clean up before and after the run.
136
185
if : ${{ always() }}
137
186
run : |
138
187
cd ..
139
188
rm -rf firedrake_venv
189
+
140
190
docker_tag :
141
191
name : " Set the Docker release tag"
142
192
runs-on : [self-hosted, Linux]
@@ -153,14 +203,15 @@ jobs:
153
203
echo The release tag is "$RELEASE_TAG"
154
204
outputs :
155
205
tag : ${{ env.RELEASE_TAG }}
206
+
156
207
docker :
157
208
name : " Build Docker containers"
158
209
# Only run on master, but always generate firedrake-env image,
159
210
# even if build fails (see docker.yml)
160
211
if : ${{ (github.ref == 'refs/heads/master') && always() }}
161
- needs : [build , docker_tag]
212
+ needs : [test , docker_tag]
162
213
uses : ./.github/workflows/docker.yml
163
214
with :
164
215
tag : ${{ needs.docker_tag.outputs.tag }}
165
- status : ${{ needs.build .result }}
216
+ status : ${{ needs.test .result }}
166
217
secrets : inherit
0 commit comments