-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add information to logs with a custom runner
Add a bash script to use as runner for our test suite This script adds information to the logs: - explicit names of the test run when they start - some explicit messages for crashes (SIGSEGV, SIGBUS, ...) - and, maybe most importantly, anchors in CI logs, so that the main webpage contains the most important information and direct links to precise points of interest in the log It is written as a bash script but making sure it can be used as a runner also on Windows CI (notably by commenting all ends of lines, without which it fails with errors about '\r's that don't exist...)
- Loading branch information
Showing
20 changed files
with
107 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
# A runner for tests that adds timestamps and, in CI, anchors in logs | ||
# All lines end as comments since bash on Windows CI seems to conjure | ||
# some '\r' it doesn’t like into existence | ||
test="$1" # | ||
warning() { # | ||
if [ "$CI" = true ] ; then # | ||
printf '\n::warning title=%s in %s/%s::%s in src/%s/%s' "$1" "${PWD##*/}" "$test" "$1" "${PWD##*/}" "$test" # | ||
else # | ||
printf '\nWarning: %s in src/%s/%s' "$1" "${PWD##*/}" "$test" # | ||
fi # | ||
} # | ||
error() { # | ||
if [ "$CI" = true ] ; then # | ||
printf '\n::error title=%s in %s/%s::%s in src/%s/%s' "$1" "${PWD##*/}" "$test" "$1" "${PWD##*/}" "$test" # | ||
else # | ||
printf '\nError: %s in src/%s/%s' "$1" "${PWD##*/}" "$test" # | ||
fi # | ||
} # | ||
# | ||
if [[ "$2" = "" ]] ; then # | ||
printf '\n\nStarting "./%s --verbose" in %s\n' "$test" "${PWD##*/}" # | ||
./"$test" --verbose # | ||
result="$?" # | ||
else # | ||
shift # | ||
printf '\n\nStarting "./%s %s" in %s\n' "$test" "$*" "${PWD##*/}" # | ||
./"$test" "$@" # | ||
result="$?" # | ||
fi # | ||
case "$result" in # | ||
0) # | ||
exit 0 # | ||
;; # | ||
1) # | ||
warning "Test failure" # | ||
exit 1 # | ||
;; # | ||
139) # | ||
error SIGSEGV # | ||
kill -SIGSEGV $$ # | ||
;; # | ||
135) # | ||
error SIGBUS # | ||
kill -SIGBUS $$ # | ||
;; # | ||
137) # | ||
error SIGKILL # | ||
kill -SIGKILL $$ # | ||
;; # | ||
134) # | ||
error SIGABRT # | ||
kill -SIGABRT $$ # | ||
;; # | ||
*) # | ||
error "$result" # | ||
exit "$result" # | ||
;; # | ||
esac # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.