@@ -77,9 +77,29 @@ Write-Host " Step 2/2: Running Tests " -ForegroundColor Yellow
7777Write-Host " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - ForegroundColor Yellow
7878Write-Host " "
7979
80- & " $ScriptDir \run_tests.ps1"
80+ # Capture test output and pass it through to console while also capturing it
81+ $TestOutput = @ ()
82+ & " $ScriptDir \run_tests.ps1" 2>&1 | Tee-Object - Variable TestOutput | Write-Host
8183$TestExitCode = $LASTEXITCODE
8284
85+ # Parse test results from captured output
86+ $TotalTests = 0
87+ $PassedTests = 0
88+ $FailedTests = 0
89+
90+ foreach ($Line in $TestOutput ) {
91+ $LineStr = $Line.ToString ()
92+ # Look for pytest summary line like "908 passed, 9 failed in 26.76s"
93+ if ($LineStr -match ' (\d+)\s+passed' ) {
94+ $PassedTests = [int ]::Parse($matches [1 ])
95+ }
96+ if ($LineStr -match ' (\d+)\s+failed' ) {
97+ $FailedTests = [int ]::Parse($matches [1 ])
98+ }
99+ }
100+
101+ $TotalTests = $PassedTests + $FailedTests
102+
83103Write-Host " "
84104
85105
@@ -92,9 +112,11 @@ Write-Host "║ Final Results ║" -ForegroundColor
92112Write-Host " ╚════════════════════════════════════════════╝" - ForegroundColor Cyan
93113Write-Host " "
94114
115+ # Determine statuses
95116$LintStatus = if ($LintExitCode -eq 0 ) { " ✅ PASSED" } else { " ⚠️ ISSUES FOUND" }
96117$TestStatus = if ($TestExitCode -eq 0 ) { " ✅ PASSED" } else { " ❌ FAILED" }
97118
119+ # Get pylint score
98120$PylintScore = $null
99121$LatestPylintText = Join-Path $ScriptDir " pylint/reports/latest.txt"
100122if (Test-Path $LatestPylintText ) {
@@ -104,17 +126,39 @@ if (Test-Path $LatestPylintText) {
104126 }
105127}
106128
107- if ($PylintScore ) {
108- $LintStatus = " $LintStatus ($PylintScore )"
109- }
110-
129+ # Set colors
111130$LintColor = if ($LintExitCode -eq 0 ) { " Green" } else { " Yellow" }
112131$TestColor = if ($TestExitCode -eq 0 ) { " Green" } else { " Red" }
113132
114- Write-Host " Pylint: " - NoNewline
115- Write-Host $LintStatus - ForegroundColor $LintColor
116- Write-Host " Tests: " - NoNewline
133+ # Calculate column widths for alignment
134+ $LabelWidth = " Pylint :" .Length # 7
135+ $Padding = " " * ($LabelWidth - 1 )
136+
137+ # Display Pylint status with score
138+ Write-Host " Pylint : " - NoNewline
139+ Write-Host $LintStatus - ForegroundColor $LintColor - NoNewline
140+ if ($PylintScore ) {
141+ Write-Host " ($PylintScore )" - ForegroundColor Gray
142+ } else {
143+ Write-Host " "
144+ }
145+
146+ # Display Test status with counts
147+ Write-Host " Tests : " - NoNewline
117148Write-Host $TestStatus - ForegroundColor $TestColor
149+
150+ # Display test counts with right-aligned numbers
151+ if ($TotalTests -gt 0 ) {
152+ # Calculate padding for right-alignment (max 5 digits)
153+ $TotalPadded = " {0,5}" -f $TotalTests
154+ $PassedPadded = " {0,5}" -f $PassedTests
155+ $FailedPadded = " {0,5}" -f $FailedTests
156+
157+ Write-Host " • Total : $TotalPadded " - ForegroundColor Gray
158+ Write-Host " • Passed : $PassedPadded " - ForegroundColor Gray
159+ Write-Host " • Failed : $FailedPadded " - ForegroundColor Gray
160+ }
161+
118162Write-Host " "
119163
120164# Determine overall exit code
@@ -127,7 +171,7 @@ if ($TestExitCode -ne 0) {
127171}
128172
129173if ($OverallExitCode -eq 0 ) {
130- Write-Host " 🎉 All checks passed! Code is ready for commit." - ForegroundColor Green
174+ Write-Host " 🎉 All checks passed! Code is ready to commit." - ForegroundColor Green
131175} else {
132176 Write-Host " ⚠️ Some checks did not pass. Please review and fix issues." - ForegroundColor Yellow
133177}
0 commit comments