Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build step to check for inet_error #1525

Merged
merged 1 commit into from Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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