Skip to content

Commit 783c224

Browse files
committed
gitlab-ci: handle failed tests on MSVC+Meson job
The MSVC+Meson job does not currently have any logic to print failing tests, nor does it upload the failed test artifacts. Backfill this logic to make help debugging efforts in case any of its jobs has failed. GitHub already knows to do this, so we don't need an equivalent change over there. Signed-off-by: Patrick Steinhardt <ps@pks.im>
1 parent c05d392 commit 783c224

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.gitlab-ci.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,19 +157,22 @@ test:mingw64:
157157
parallel: 10
158158

159159
.msvc-meson:
160+
variables:
161+
TEST_OUTPUT_DIRECTORY: "C:/Git-Test"
160162
tags:
161163
- saas-windows-medium-amd64
162164
before_script:
163165
- *windows_before_script
164166
- choco install -y git meson ninja rust-ms
165167
- Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
166168
- refreshenv
169+
- New-Item -Path $env:TEST_OUTPUT_DIRECTORY -ItemType Directory
167170

168171
build:msvc-meson:
169172
extends: .msvc-meson
170173
stage: build
171174
script:
172-
- meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcredential_helpers=wincred
175+
- meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcredential_helpers=wincred -Dtest_output_directory="$TEST_OUTPUT_DIRECTORY"
173176
- meson compile -C build
174177
artifacts:
175178
paths:
@@ -185,10 +188,19 @@ test:msvc-meson:
185188
script:
186189
- |
187190
& "C:/Program Files/Git/usr/bin/bash.exe" -l -c 'ci/run-test-slice-meson.sh build $CI_NODE_INDEX $CI_NODE_TOTAL'
191+
after_script:
192+
- |
193+
if ($env:CI_JOB_STATUS -ne "success") {
194+
& "C:/Program Files/Git/usr/bin/bash.exe" -l -c 'ci/print-test-failures.sh'
195+
Move-Item -Path "$env:TEST_OUTPUT_DIRECTORY/failed-test-artifacts" -Destination t/
196+
}
188197
parallel: 10
189198
artifacts:
199+
paths:
200+
- t/failed-test-artifacts
190201
reports:
191202
junit: build/meson-logs/testlog.junit.xml
203+
when: on_failure
192204

193205
test:fuzz-smoke-tests:
194206
image: ubuntu:latest

0 commit comments

Comments
 (0)