@@ -69,22 +69,28 @@ jobs:
6969 Write-Host "Running test: $testName"
7070
7171 try {
72- # Run the test and capture exit code
73- & $_.FullName 2>&1 | Out-Null
72+ # Run the test and capture output and exit code
73+ $output = & $_.FullName 2>&1
7474 $exitCode = $LASTEXITCODE
7575
7676 if ($exitCode -eq 0) {
7777 $passedTests++
78- $testResults += "✅ $testName - PASSED"
78+ # Include output in the result
79+ $outputText = if ($output) { "`n Output: $($output -join "`n ")" } else { "" }
80+ $testResults += "✅ $testName - PASSED$outputText"
7981 Write-Host "✅ Test passed: $testName"
8082 } else {
8183 $failedTests++
82- $testResults += "❌ $testName - FAILED (Exit code: $exitCode)"
84+ # Include output and exit code in the result
85+ $outputText = if ($output) { "`n Output: $($output -join "`n ")" } else { "" }
86+ $testResults += "❌ $testName - FAILED (Exit code: $exitCode)$outputText"
8387 Write-Host "❌ Test failed: $testName (Exit code: $exitCode)"
8488 }
8589 } catch {
8690 $failedTests++
87- $testResults += "❌ $testName - FAILED (Exception: $_)"
91+ # Include exception and any captured output
92+ $outputText = if ($output) { "`n Output: $($output -join "`n ")" } else { "" }
93+ $testResults += "❌ $testName - FAILED (Exception: $_)$outputText"
8894 Write-Host "❌ Test failed with exception: $testName"
8995 }
9096 }
@@ -123,8 +129,12 @@ jobs:
123129 if : always()
124130 shell : pwsh
125131 run : |
132+ # Determine job status based on previous steps
133+ $jobStatus = if ("${{ steps.run_tests.outcome }}" -eq "success") { "success" } else { "failure" }
134+
126135 $results = @{
127136 arch = "${{ matrix.arch }}"
137+ status = $jobStatus
128138 total = "${{ steps.run_tests.outputs.total }}"
129139 passed = "${{ steps.run_tests.outputs.passed }}"
130140 failed = "${{ steps.run_tests.outputs.failed }}"
@@ -171,17 +181,26 @@ jobs:
171181 for (const file of files) {
172182 const data = JSON.parse(fs.readFileSync(file, 'utf8'));
173183 const arch = data.arch;
184+ const status = data.status || 'unknown';
174185 const total = data.total || 0;
175186 const passed = data.passed || 0;
176187 const failed = data.failed || 0;
177188
178- if (failed > 0) {
189+ // Mark as failed if either tests failed OR job status is not success
190+ if (failed > 0 || status !== 'success') {
179191 allPassed = false;
180192 }
181193
182- const status = failed === 0 ? '✅' : '❌';
183- commentBody += `### ${status} ${arch.toUpperCase()}\n`;
184- commentBody += `**${passed}/${total} tests passed**\n\n`;
194+ // Determine emoji based on both test results and job status
195+ const emoji = (failed === 0 && status === 'success') ? '✅' : '❌';
196+ commentBody += `### ${emoji} ${arch.toUpperCase()}\n`;
197+
198+ // Show appropriate message based on job status
199+ if (status !== 'success') {
200+ commentBody += `**Job failed** - Tests may not have run due to compile or setup failure\n\n`;
201+ } else {
202+ commentBody += `**${passed}/${total} tests passed**\n\n`;
203+ }
185204
186205 if (data.details && data.details.trim()) {
187206 commentBody += '<details>\n';
0 commit comments