diff options
| author | Martin Robertz <dream-master@gmx.net> | 2022-03-03 00:25:47 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-03 00:25:47 +0100 |
| commit | 0a05a6c21d1422cbabc6ae5154b01588f095c9fd (patch) | |
| tree | d5fbd790cd021dbf52ec664b3217bbee7406683e /.github/scripts/test_no_error_reports | |
| parent | d27daa7313329beabd5b6d322c5032ccc38b5076 (diff) | |
| parent | b587d65eae535780f4459f6825fa16e3c602421f (diff) | |
| download | GT5-Unofficial-0a05a6c21d1422cbabc6ae5154b01588f095c9fd.tar.gz GT5-Unofficial-0a05a6c21d1422cbabc6ae5154b01588f095c9fd.tar.bz2 GT5-Unofficial-0a05a6c21d1422cbabc6ae5154b01588f095c9fd.zip | |
Merge pull request #8 from GTNewHorizons/maven
build to maven
Diffstat (limited to '.github/scripts/test_no_error_reports')
| -rwxr-xr-x | .github/scripts/test_no_error_reports | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/.github/scripts/test_no_error_reports b/.github/scripts/test_no_error_reports new file mode 100755 index 0000000000..1fcc7396c6 --- /dev/null +++ b/.github/scripts/test_no_error_reports @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +# bashsupport disable=BP5006 # Global environment variables +RUNDIR="run" \ + CRASH="crash-reports" \ + SERVERLOG="server.log" + +# enable nullglob to get 0 results when no match rather than the pattern +shopt -s nullglob + +# store matches in array +crash_reports=("$RUNDIR/$CRASH/crash"*.txt) + +# if array not empty there are crash_reports +if [ "${#crash_reports[@]}" -gt 0 ]; then + # get the latest crash_report from array + latest_crash_report="${crash_reports[-1]}" + { + printf 'Latest crash report detected %s:\n' "${latest_crash_report##*/}" + cat "$latest_crash_report" + } >&2 + exit 1 +fi + +if grep --quiet --fixed-strings 'Fatal errors were detected' "$SERVERLOG"; then + { + printf 'Fatal errors detected:\n' + cat server.log + } >&2 + exit 1 +fi + +if grep --quiet --fixed-strings 'The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED' \ + "$SERVERLOG"; then + { + printf 'Server force stopped:' + cat server.log + } >&2 + exit 1 +fi + +if ! grep --quiet --perl-regexp --only-matching '.+Done \(.+\)\! For help, type "help" or "\?"' "$SERVERLOG"; then + { + printf 'Server did not finish startup:' + cat server.log + } >&2 + exit 1 +fi + +printf 'No crash reports detected' +exit 0 |
