Skip to content

Commit e0367ad

Browse files
committed
Add build step to check for inet_error
Related to: * #1524 * 1fa0562
1 parent eaa7e33 commit e0367ad

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

.ci/ubuntu/gha-log-check.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -o errexit
4+
set -o pipefail
5+
set -o xtrace
6+
set -o nounset
7+
8+
readonly docker_name_prefix='rabbitmq-dotnet-client'
9+
10+
declare -r rabbitmq_docker_name="$docker_name_prefix-rabbitmq"
11+
12+
if docker logs "$rabbitmq_docker_name" | grep -iF inet_error
13+
then
14+
echo '[ERROR] found inet_error in RabbitMQ logs' 1>&2
15+
exit 1
16+
fi

.ci/windows/gha-log-check.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
$ProgressPreference = 'Continue'
2+
$VerbosePreference = 'Continue'
3+
$ErrorActionPreference = 'Stop'
4+
Set-StrictMode -Version 2.0
5+
6+
$rabbitmq_log_dir = Join-Path -Path $env:AppData -ChildPath 'RabbitMQ' | Join-Path -ChildPath 'log'
7+
Write-Host "[INFO] looking for errors in '$rabbitmq_log_dir'"
8+
9+
If (Get-ChildItem $rabbitmq_log_dir\*.log | Select-String -Quiet -SimpleMatch -Pattern inet_error)
10+
{
11+
Write-Error "[ERROR] found inet_error in '$rabbitmq_log_dir'"
12+
exit 1
13+
}

.github/workflows/build-test.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
path: projects
6666
- name: Install and Start RabbitMQ
6767
id: install-start-rabbitmq
68-
run: .\.ci\windows\gha-setup.ps1
68+
run: ${{ github.workspace }}\.ci\windows\gha-setup.ps1
6969
- name: Integration Tests
7070
run: |
7171
$tx = Start-Job -Verbose -ScriptBlock { & "${{ github.workspace }}\.ci\windows\toxiproxy\toxiproxy-server.exe" }; `
@@ -79,6 +79,8 @@ jobs:
7979
--environment 'PASSWORD=grapefruit' `
8080
--environment SSL_CERTS_DIR="${{ github.workspace }}\.ci\certs" `
8181
"${{ github.workspace }}\projects\Test\Integration\Integration.csproj" --no-restore --no-build --logger 'console;verbosity=detailed'
82+
- name: Check for errors in RabbitMQ logs
83+
run: ${{ github.workspace }}\.ci\windows\gha-log-check.ps1
8284
- name: Maybe upload RabbitMQ logs
8385
if: failure()
8486
uses: actions/upload-artifact@v4
@@ -110,7 +112,7 @@ jobs:
110112
path: projects
111113
- name: Install and Start RabbitMQ
112114
id: install-start-rabbitmq
113-
run: .\.ci\windows\gha-setup.ps1
115+
run: ${{ github.workspace }}\.ci\windows\gha-setup.ps1
114116
- name: Sequential Integration Tests
115117
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'
116118
- name: Maybe upload RabbitMQ logs
@@ -186,6 +188,8 @@ jobs:
186188
--environment 'PASSWORD=grapefruit' \
187189
--environment SSL_CERTS_DIR="${{ github.workspace }}/.ci/certs" \
188190
"${{ github.workspace }}/projects/Test/Integration/Integration.csproj" --no-restore --no-build --logger 'console;verbosity=detailed'
191+
- name: Check for errors in RabbitMQ logs
192+
run: ${{ github.workspace}}/.ci/ubuntu/gha-log-check.sh
189193
- name: Maybe upload RabbitMQ logs
190194
if: failure()
191195
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)