diff --git a/.ci/ubuntu/gha-log-check.sh b/.ci/ubuntu/gha-log-check.sh new file mode 100644 index 000000000..8301df1f3 --- /dev/null +++ b/.ci/ubuntu/gha-log-check.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -o errexit +set -o pipefail +set -o xtrace +set -o nounset + +readonly docker_name_prefix='rabbitmq-dotnet-client' + +declare -r rabbitmq_docker_name="$docker_name_prefix-rabbitmq" + +if docker logs "$rabbitmq_docker_name" | grep -iF inet_error +then + echo '[ERROR] found inet_error in RabbitMQ logs' 1>&2 + exit 1 +fi diff --git a/.ci/windows/gha-log-check.ps1 b/.ci/windows/gha-log-check.ps1 new file mode 100644 index 000000000..06987e0c6 --- /dev/null +++ b/.ci/windows/gha-log-check.ps1 @@ -0,0 +1,13 @@ +$ProgressPreference = 'Continue' +$VerbosePreference = 'Continue' +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 + +$rabbitmq_log_dir = Join-Path -Path $env:AppData -ChildPath 'RabbitMQ' | Join-Path -ChildPath 'log' +Write-Host "[INFO] looking for errors in '$rabbitmq_log_dir'" + +If (Get-ChildItem $rabbitmq_log_dir\*.log | Select-String -Quiet -SimpleMatch -Pattern inet_error) +{ + Write-Errors "[ERROR] found inet_error in '$rabbitmq_log_dir'" + exit 1 +} diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index 15c3e0384..d4b30907a 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -66,11 +66,13 @@ jobs: path: projects - name: Install and Start RabbitMQ id: install-start-rabbitmq - run: .\.ci\windows\gha-setup.ps1 + run: ${{ github.workspace }}\.ci\windows\gha-setup.ps1 - name: Async Integration Tests run: dotnet test --environment "RABBITMQ_RABBITMQCTL_PATH=${{ steps.install-start-rabbitmq.outputs.path }}" --environment 'RABBITMQ_LONG_RUNNING_TESTS=true' "${{ github.workspace }}\projects\Test\AsyncIntegration\AsyncIntegration.csproj" --no-restore --no-build --logger 'console;verbosity=detailed' - name: Integration Tests run: dotnet test --environment "RABBITMQ_RABBITMQCTL_PATH=${{ steps.install-start-rabbitmq.outputs.path }}" --environment 'RABBITMQ_LONG_RUNNING_TESTS=true' --environment 'PASSWORD=grapefruit' --environment SSL_CERTS_DIR="${{ github.workspace }}\.ci\certs" "${{ github.workspace }}\projects\Test\Integration\Integration.csproj" --no-restore --no-build --logger 'console;verbosity=detailed' + - name: Check for errors in RabbitMQ logs + run: ${{ github.workspace }}\.ci\windows\gha-log-check.ps1 - name: Maybe upload RabbitMQ logs if: failure() uses: actions/upload-artifact@v3 @@ -102,7 +104,7 @@ jobs: path: projects - name: Install and Start RabbitMQ id: install-start-rabbitmq - run: .\.ci\windows\gha-setup.ps1 + run: ${{ github.workspace }}\.ci\windows\gha-setup.ps1 - name: Sequential Integration Tests run: dotnet test --environment "RABBITMQ_RABBITMQCTL_PATH=${{ steps.install-start-rabbitmq.outputs.path }}" "${{ github.workspace }}\projects\Test\SequentialIntegration\SequentialIntegration.csproj" --no-restore --no-build --logger 'console;verbosity=detailed' - name: Maybe upload RabbitMQ logs @@ -183,6 +185,8 @@ jobs: --environment 'PASSWORD=grapefruit' \ --environment SSL_CERTS_DIR="${{ github.workspace }}/.ci/certs" \ "${{ github.workspace }}/projects/Test/Integration/Integration.csproj" --no-restore --no-build --logger 'console;verbosity=detailed' + - name: Check for errors in RabbitMQ logs + run: ${{ github.workspace}}/.ci/ubuntu/gha-log-check.sh - name: Maybe upload RabbitMQ logs if: failure() uses: actions/upload-artifact@v3