Skip to content

Commit f317b12

Browse files
committed
Generate dotnet test diag logs on GH and upload on failure
1 parent c62acc8 commit f317b12

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

.github/workflows/wf_build-and-test.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,15 @@ jobs:
3535
run: ${{ github.workspace }}\.ci\windows\gha-setup.ps1
3636
- name: Test
3737
timeout-minutes: 25
38-
run: dotnet test ${{ github.workspace }}\Build.csproj --environment=RABBITMQ_CLIENT_TESTS_VERBOSE=true --no-restore --no-build --logger 'console;verbosity=detailed'
38+
run: dotnet test ${{ github.workspace }}\Build.csproj --diag ${{ github.workspace}}\diag --no-restore --no-build --logger 'console;verbosity=detailed'
3939
- name: Check for errors in RabbitMQ logs
4040
run: ${{ github.workspace }}\.ci\windows\gha-log-check.ps1
41+
- name: Upload dotnet test diag logs (on failure)
42+
if: failure()
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: dotnet-test-diag-win32
46+
path: ${{ github.workspace }}/diag/
4147
- name: Maybe upload RabbitMQ logs
4248
if: failure()
4349
uses: actions/upload-artifact@v4
@@ -63,12 +69,18 @@ jobs:
6369
run: ${{ github.workspace }}/.ci/ubuntu/cluster/gha-setup.sh
6470
- name: Test
6571
timeout-minutes: 25
66-
run: dotnet test ${{ github.workspace }}/Build.csproj --environment=RABBITMQ_CLIENT_TESTS_VERBOSE=true --no-restore --no-build --logger "console;verbosity=detailed"
72+
run: dotnet test ${{ github.workspace }}/Build.csproj --diag ${{ github.workspace}}/diag --no-restore --no-build --logger "console;verbosity=detailed"
6773
- name: Check for errors in RabbitMQ logs
6874
run: ${{ github.workspace}}/.ci/ubuntu/cluster/gha-logs.sh check
6975
- name: Collect RabbitMQ logs (on failure)
7076
if: failure()
7177
run: ${{ github.workspace}}/.ci/ubuntu/cluster/gha-logs.sh
78+
- name: Upload dotnet test diag logs (on failure)
79+
if: failure()
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: dotnet-test-diag-ubuntu
83+
path: ${{ github.workspace }}/diag/
7284
- name: Upload RabbitMQ logs (on failure)
7385
if: failure()
7486
uses: actions/upload-artifact@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ gensrc/
2525
.ionide/
2626
NuGet/
2727
tmp/
28+
diag/
2829
.vscode/
2930

3031
#################

build.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ if ($RunTests -or $RunTestsUntilFailure)
3232
Write-Host "Running tests: Build.csproj traversal (all frameworks)" -ForegroundColor "Magenta"
3333
if ($verbose)
3434
{
35-
dotnet test $build_csproj_file --diag test-diag.log --environment=RABBITMQ_CLIENT_TESTS_VERBOSE=true --no-build --logger 'console;verbosity=detailed'
35+
# dotnet test $build_csproj_file --diag $(Join-Path -Path $PSScriptRoot -ChildPath diag.log) --environment=RABBITMQ_CLIENT_TESTS_VERBOSE=true --no-build --logger 'console;verbosity=detailed'
36+
dotnet test $build_csproj_file --diag $(Join-Path -Path $PSScriptRoot -ChildPath diag | Join-Path -ChildPath diag.log) --no-build --logger 'console;verbosity=detailed'
3637
}
3738
else
3839
{

0 commit comments

Comments
 (0)