Skip to content

Commit 429c7f1

Browse files
committed
ci: don't stop on failure
Don't stop on test failures; run all the tests, even when a test fails.
1 parent 7c9769d commit 429c7f1

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

ci/test.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ $PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
77

88
$SourceDir = Split-Path (Split-Path (Get-Variable MyInvocation).Value.MyCommand.Path)
99
$BuildDir = Get-Location
10+
$Success = $true
1011

1112
if ($Env:SKIP_TESTS) { exit }
1213

@@ -24,7 +25,7 @@ function run_test {
2425
Write-Host $TestCommand
2526
Invoke-Expression $TestCommand
2627

27-
if ($LastExitCode -ne 0) { [Environment]::Exit($LastExitCode) }
28+
if ($LastExitCode -ne 0) { $Success = $false }
2829
}
2930

3031
Write-Host "##############################################################################"
@@ -67,3 +68,5 @@ if (-not $Env:SKIP_PROXY_TESTS) {
6768

6869
taskkill /F /IM javaw.exe
6970
}
71+
72+
if (-not $Success) { exit 1 }

ci/test.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ BUILD_DIR=$(pwd)
1111
TMPDIR=${TMPDIR:-/tmp}
1212
USER=${USER:-$(whoami)}
1313

14+
SUCCESS=1
15+
1416
VALGRIND="valgrind --leak-check=full --show-reachable=yes --error-exitcode=125 --num-callers=50 --suppressions=\"$SOURCE_DIR/libgit2_clar.supp\""
1517
LEAKS="MallocStackLogging=1 MallocScribble=1 leaks -quiet -atExit -- nohup"
1618

@@ -30,11 +32,9 @@ cleanup() {
3032
echo "Done."
3133
}
3234

33-
die() {
35+
failure() {
3436
echo "Test exited with code: $1"
35-
36-
cleanup
37-
exit $1
37+
SUCCESS=0
3838
}
3939

4040
# Ask ctest what it would run if we were to invoke it directly. This lets
@@ -54,7 +54,7 @@ run_test() {
5454
RUNNER="$TEST_CMD"
5555
fi
5656

57-
eval $RUNNER || die $?
57+
eval $RUNNER || failure
5858
}
5959

6060
# Configure the test environment; run them early so that we're certain
@@ -194,10 +194,16 @@ if [ -z "$SKIP_FUZZERS" ]; then
194194
echo "##############################################################################"
195195

196196
for fuzzer in fuzzers/*_fuzzer; do
197-
"${fuzzer}" "${SOURCE_DIR}/fuzzers/corpora/$(basename "${fuzzer%_fuzzer}")" || die $?
197+
"${fuzzer}" "${SOURCE_DIR}/fuzzers/corpora/$(basename "${fuzzer%_fuzzer}")" || failure
198198
done
199199
fi
200200

201-
echo "Success."
202201
cleanup
202+
203+
if [ "$SUCCESS" -ne "1" ]; then
204+
echo "Some tests failed."
205+
exit 1
206+
fi
207+
208+
echo "Success."
203209
exit 0

0 commit comments

Comments
 (0)