Skip to content

Commit 86a3225

Browse files
committed
* Be sure to get cluster logs on failure
1 parent 773ce64 commit 86a3225

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.ci/ubuntu/cluster/gha-log-check.sh renamed to .ci/ubuntu/cluster/gha-logs.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ set -o errexit
44
set -o pipefail
55
set -o xtrace
66

7+
readonly arg1="${1:-undefined}"
8+
79
function now
810
{
911
date '+%Y%m%d-%H%M%S'
@@ -26,8 +28,11 @@ run_docker_compose logs rmq0 > "$log_dir/rmq0.log"
2628
run_docker_compose logs rmq1 > "$log_dir/rmq1.log"
2729
run_docker_compose logs rmq2 > "$log_dir/rmq2.log"
2830

29-
if grep -iF inet_error "$log_dir"/*
31+
if [[ $arg1 == 'check' ]]
3032
then
31-
echo '[ERROR] found inet_error in RabbitMQ logs' 1>&2
32-
exit 1
33+
if grep -iF inet_error "$log_dir"/*
34+
then
35+
echo '[ERROR] found inet_error in RabbitMQ logs' 1>&2
36+
exit 1
37+
fi
3338
fi

.github/workflows/build-test.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,11 @@ jobs:
6767
timeout-minutes: 15
6868
run: dotnet test ${{ github.workspace }}/Build.csproj --no-restore --no-build --logger "console;verbosity=detailed"
6969
- name: Check for errors in RabbitMQ logs
70-
run: ${{ github.workspace}}/.ci/ubuntu/cluster/gha-log-check.sh
71-
- name: Maybe upload RabbitMQ logs
70+
run: ${{ github.workspace}}/.ci/ubuntu/cluster/gha-logs.sh check
71+
- name: Collect RabbitMQ logs (on failure)
72+
if: failure()
73+
run: ${{ github.workspace}}/.ci/ubuntu/cluster/gha-logs.sh
74+
- name: Upload RabbitMQ logs (on failure)
7275
if: failure()
7376
uses: actions/upload-artifact@v4
7477
with:

0 commit comments

Comments
 (0)