Skip to content

Commit

Permalink
Merge pull request SinTh0r4s#50 from SinTh0r4s/ci-detect-server-failu…
Browse files Browse the repository at this point in the history
…re-without-apparent-crash

CI: make error checking in testing more robust
  • Loading branch information
TheElan authored Dec 15, 2021
2 parents df8a8cd + e882491 commit 7b5de57
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 14 deletions.
9 changes: 0 additions & 9 deletions .github/scripts/test-no-crash-reports.sh

This file was deleted.

27 changes: 27 additions & 0 deletions .github/scripts/test-no-error-reports.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
if [[ -d "run/crash-reports" ]]; then
echo "Crash reports detected:"
cat $directory/*
exit 1
fi

if grep --quiet "Fatal errors were detected" server.log; then
echo "Fatal errors detected:"
cat server.log
exit 1
fi

if grep --quiet "The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED" server.log; then
echo "Server force stopped:"
cat server.log
exit 1
fi

if grep --quiet 'Done .+ For help, type "help" or "?"' server.log; then
echo "Server didn't finish startup:"
cat server.log
exit 1
fi

echo "No crash reports detected"
exit 0

10 changes: 5 additions & 5 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ jobs:
- name: Build the mod
run: ./gradlew build

- name: Run server for 1 minute
- name: Run server for 1.5 minutes
run: |
mkdir run
echo "eula=true" > run/eula.txt
timeout 60 ./gradlew runServer || true
timeout 90 ./gradlew runServer | tee --append server.log || true
- name: Test no crashes happend
- name: Test no errors reported during server run
run: |
chmod +x .github/scripts/test-no-crash-reports.sh
.github/scripts/test-no-crash-reports.sh
chmod +x .github/scripts/test-no-error-reports.sh
.github/scripts/test-no-error-reports.sh

0 comments on commit 7b5de57

Please sign in to comment.