Skip to content

Commit

Permalink
Add build step to check for inet_error
Browse files Browse the repository at this point in the history
Related to:
* #1524
* 1fa0562
  • Loading branch information
lukebakken committed Mar 27, 2024
1 parent eaa7e33 commit e0367ad
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .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
13 changes: 13 additions & 0 deletions .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-Error "[ERROR] found inet_error in '$rabbitmq_log_dir'"
exit 1
}
8 changes: 6 additions & 2 deletions .github/workflows/build-test.yaml
Expand Up @@ -65,7 +65,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: Integration Tests
run: |
$tx = Start-Job -Verbose -ScriptBlock { & "${{ github.workspace }}\.ci\windows\toxiproxy\toxiproxy-server.exe" }; `
Expand All @@ -79,6 +79,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\windows\gha-log-check.ps1
- name: Maybe upload RabbitMQ logs
if: failure()
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -110,7 +112,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
Expand Down Expand Up @@ -186,6 +188,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@v4
Expand Down

0 comments on commit e0367ad

Please sign in to comment.