Skip to content

Commit 98b116c

Browse files
add debug logging on PR
1 parent faef941 commit 98b116c

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/pullrequest.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,22 @@ jobs:
3232
3333
- name: Build Docker Image
3434
run: docker build . --file TransactionProcessor/Dockerfile --tag transactionprocessor:latest
35-
35+
3636
- name: Run Integration Tests
37-
run: dotnet test "TransactionProcessor.IntegrationTests\TransactionProcessor.IntegrationTests.csproj" --filter Category=PRTest
37+
run: dotnet test "TransactionProcessor.IntegrationTests\TransactionProcessor.IntegrationTests.csproj" --filter Category=PRTest --logger "trx;LogFileName=test-results.trx"
38+
39+
- name: Extract Failed Tests (PowerShell)
40+
if: ${{ failure() }}
41+
run: |
42+
$xml = [xml](Get-Content test-results.trx)
43+
$failedTests = $xml.TestRun.Results.UnitTestResult | Where-Object { $_.outcome -eq "Failed" }
44+
if ($failedTests) {
45+
Write-Host "::error::Failed Tests:"
46+
foreach ($test in $failedTests) {
47+
Write-Host "::error::- $($test.testName)"
48+
}
49+
}
50+
shell: pwsh
3851

3952
- uses: actions/[email protected]
4053
if: ${{ failure() }}

0 commit comments

Comments
 (0)