mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
ci: don't stop on failure
Don't stop on test failures; run all the tests, even when a test fails.
(cherry picked from commit 429c7f1141)
This commit is contained in:
committed by
Patrick Steinhardt
parent
0fe9313a36
commit
125d80d0c0
@@ -7,6 +7,7 @@ $PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
|
||||
|
||||
$SourceDir = Split-Path (Split-Path (Get-Variable MyInvocation).Value.MyCommand.Path)
|
||||
$BuildDir = Get-Location
|
||||
$Success = $true
|
||||
|
||||
if ($Env:SKIP_TESTS) { exit }
|
||||
|
||||
@@ -24,7 +25,7 @@ function run_test {
|
||||
Write-Host $TestCommand
|
||||
Invoke-Expression $TestCommand
|
||||
|
||||
if ($LastExitCode -ne 0) { [Environment]::Exit($LastExitCode) }
|
||||
if ($LastExitCode -ne 0) { $Success = $false }
|
||||
}
|
||||
|
||||
Write-Host "##############################################################################"
|
||||
@@ -67,3 +68,5 @@ if (-not $Env:SKIP_PROXY_TESTS) {
|
||||
|
||||
taskkill /F /IM javaw.exe
|
||||
}
|
||||
|
||||
if (-not $Success) { exit 1 }
|
||||
|
||||
18
ci/test.sh
18
ci/test.sh
@@ -11,6 +11,8 @@ BUILD_DIR=$(pwd)
|
||||
TMPDIR=${TMPDIR:-/tmp}
|
||||
USER=${USER:-$(whoami)}
|
||||
|
||||
SUCCESS=1
|
||||
|
||||
VALGRIND="valgrind --leak-check=full --show-reachable=yes --error-exitcode=125 --num-callers=50 --suppressions=\"$SOURCE_DIR/libgit2_clar.supp\""
|
||||
LEAKS="MallocStackLogging=1 MallocScribble=1 leaks -quiet -atExit -- nohup"
|
||||
|
||||
@@ -30,11 +32,9 @@ cleanup() {
|
||||
echo "Done."
|
||||
}
|
||||
|
||||
die() {
|
||||
failure() {
|
||||
echo "Test exited with code: $1"
|
||||
|
||||
cleanup
|
||||
exit $1
|
||||
SUCCESS=0
|
||||
}
|
||||
|
||||
# Ask ctest what it would run if we were to invoke it directly. This lets
|
||||
@@ -54,7 +54,7 @@ run_test() {
|
||||
RUNNER="$TEST_CMD"
|
||||
fi
|
||||
|
||||
eval $RUNNER || die $?
|
||||
eval $RUNNER || failure
|
||||
}
|
||||
|
||||
# Configure the test environment; run them early so that we're certain
|
||||
@@ -187,6 +187,12 @@ if [ -z "$SKIP_SSH_TESTS" ]; then
|
||||
unset GITTEST_REMOTE_SSH_FINGERPRINT
|
||||
fi
|
||||
|
||||
echo "Success."
|
||||
cleanup
|
||||
|
||||
if [ "$SUCCESS" -ne "1" ]; then
|
||||
echo "Some tests failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Success."
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user