Skip to content

Commit

Permalink
* Be sure to get cluster logs on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebakken committed Sep 15, 2024
1 parent 773ce64 commit 86a3225
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -o errexit
set -o pipefail
set -o xtrace

readonly arg1="${1:-undefined}"

function now
{
date '+%Y%m%d-%H%M%S'
Expand All @@ -26,8 +28,11 @@ run_docker_compose logs rmq0 > "$log_dir/rmq0.log"
run_docker_compose logs rmq1 > "$log_dir/rmq1.log"
run_docker_compose logs rmq2 > "$log_dir/rmq2.log"

if grep -iF inet_error "$log_dir"/*
if [[ $arg1 == 'check' ]]
then
echo '[ERROR] found inet_error in RabbitMQ logs' 1>&2
exit 1
if grep -iF inet_error "$log_dir"/*
then
echo '[ERROR] found inet_error in RabbitMQ logs' 1>&2
exit 1
fi
fi
7 changes: 5 additions & 2 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ jobs:
timeout-minutes: 15
run: dotnet test ${{ github.workspace }}/Build.csproj --no-restore --no-build --logger "console;verbosity=detailed"
- name: Check for errors in RabbitMQ logs
run: ${{ github.workspace}}/.ci/ubuntu/cluster/gha-log-check.sh
- name: Maybe upload RabbitMQ logs
run: ${{ github.workspace}}/.ci/ubuntu/cluster/gha-logs.sh check
- name: Collect RabbitMQ logs (on failure)
if: failure()
run: ${{ github.workspace}}/.ci/ubuntu/cluster/gha-logs.sh
- name: Upload RabbitMQ logs (on failure)
if: failure()
uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit 86a3225

Please sign in to comment.