Skip to content

Commit 9976240

Browse files
authored
win enable gha (#19)
1 parent dbfa2ed commit 9976240

File tree

3 files changed

+46
-43
lines changed

3 files changed

+46
-43
lines changed

.github/workflows/test-scripts.yml

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -290,56 +290,56 @@ jobs:
290290
)
291291
292292
$overallFailed = $false
293-
$logRoot = Join-Path $env:TEMP "now-tests"
294-
New-Item -ItemType Directory -Force -Path $logRoot | Out-Null
295-
$logPath = Join-Path $logRoot "run_test_app_nodejs.log"
296-
297-
Write-Host "================================"
298-
Write-Host "Testing: $scriptPath --silent app nodejs"
299-
Write-Host "================================"
300-
301-
& $scriptPath --silent app nodejs 2>&1 | Tee-Object -FilePath $logPath -Append
302-
$exitCode = $LASTEXITCODE
303-
304-
if ($exitCode -eq 0) {
305-
Write-Host "✅ app / nodejs completed (exit code: $exitCode)"
306-
} else {
307-
Write-Host "⚠️ app / nodejs exited with code: $exitCode"
308-
if (Test-Path $logPath) {
309-
Write-Host "Log output (last 20 lines):"
310-
Get-Content -Path $logPath -Tail 20
311-
}
312-
exit 1
313-
}
314-
315293
# $logRoot = Join-Path $env:TEMP "now-tests"
316294
# New-Item -ItemType Directory -Force -Path $logRoot | Out-Null
295+
# $logPath = Join-Path $logRoot "run_test_app_nodejs.log"
296+
297+
# Write-Host "================================"
298+
# Write-Host "Testing: $scriptPath --silent app nodejs"
299+
# Write-Host "================================"
300+
301+
# & $scriptPath --silent app nodejs 2>&1 | Tee-Object -FilePath $logPath -Append
302+
# $exitCode = $LASTEXITCODE
303+
304+
# if ($exitCode -eq 0) {
305+
# Write-Host "✅ app / nodejs completed (exit code: $exitCode)"
306+
# } else {
307+
# Write-Host "⚠️ app / nodejs exited with code: $exitCode"
308+
# if (Test-Path $logPath) {
309+
# Write-Host "Log output (last 20 lines):"
310+
# Get-Content -Path $logPath -Tail 20
311+
# }
312+
# exit 1
313+
# }
317314
318-
# foreach ($config in $testConfigs) {
319-
# $testType = $config[0]
320-
# $techStack = $config[1]
315+
$logRoot = Join-Path $env:TEMP "now-tests"
316+
New-Item -ItemType Directory -Force -Path $logRoot | Out-Null
321317
322-
# Write-Host "================================"
323-
# Write-Host "Testing: $scriptPath --silent $testType $techStack"
324-
# Write-Host "================================"
318+
foreach ($config in $testConfigs) {
319+
$testType = $config[0]
320+
$techStack = $config[1]
325321
326-
# $logPath = Join-Path $logRoot "run_test_${testType}_${techStack}.log"
322+
Write-Host "================================"
323+
Write-Host "Testing: $scriptPath --silent $testType $techStack"
324+
Write-Host "================================"
327325
328-
# & $scriptPath --silent $testType $techStack 2>&1 | Tee-Object -FilePath $logPath -Append
329-
# $exitCode = $LASTEXITCODE
326+
$logPath = Join-Path $logRoot "run_test_${testType}_${techStack}.log"
330327
331-
# if ($exitCode -eq 0) {
332-
# Write-Host "✅ $testType / $techStack completed (exit code: $exitCode)"
333-
# } else {
334-
# Write-Host "⚠️ $testType / $techStack exited with code: $exitCode"
335-
# $overallFailed = $true
328+
& $scriptPath --silent $testType $techStack 2>&1 | Tee-Object -FilePath $logPath -Append
329+
$exitCode = $LASTEXITCODE
336330
337-
# if (Test-Path $logPath) {
338-
# Write-Host "Log output (last 20 lines):"
339-
# Get-Content -Path $logPath -Tail 20
340-
# }
341-
# }
342-
# }
331+
if ($exitCode -eq 0) {
332+
Write-Host "✅ $testType / $techStack completed (exit code: $exitCode)"
333+
} else {
334+
Write-Host "⚠️ $testType / $techStack exited with code: $exitCode"
335+
$overallFailed = $true
336+
337+
if (Test-Path $logPath) {
338+
Write-Host "Log output (last 20 lines):"
339+
Get-Content -Path $logPath -Tail 20
340+
}
341+
}
342+
}
343343
344344
if ($overallFailed) {
345345
Write-Error "One or more configurations failed."

win/common-utils.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ function Invoke-External {
169169
}
170170

171171
$stdoutEvent = Register-ObjectEvent -InputObject $p -EventName OutputDataReceived -Action $stdoutAction -MessageData $LogFile
172-
$stderrEvent = Register-ObjectEvent -InputObject $p -EventName ErrorDataReceived -Action $stderrAction -MessageData $LogFile
172+
$stderrEvent = Register-ObjectEvent -InputObject $p -EventName ErrorDataReceived -Action $stderrAction -MessageData $ERR_LOG
173173

174174
[void]$p.Start()
175175
$p.BeginOutputReadLine()

win/run.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,16 @@ try {
5050

5151
# Setup log file path AFTER selections
5252
$logFileName = "{0}_{1}_run_result.log" -f $TEST_TYPE.ToLowerInvariant(), $TECH_STACK.ToLowerInvariant()
53+
$errLogFileName = "{0}_{1}_run_result.err" -f $TEST_TYPE.ToLowerInvariant(), $TECH_STACK.ToLowerInvariant()
5354
$logFile = Join-Path $LOG_DIR $logFileName
55+
$errLogFile = Join-Path $env:TEMP $errLogFileName
5456
if (!(Test-Path $LOG_DIR)) {
5557
New-Item -ItemType Directory -Path $LOG_DIR -Force | Out-Null
5658
}
5759
'' | Out-File -FilePath $logFile -Encoding UTF8
5860
Set-RunLogFile $logFile
5961
$script:GLOBAL_LOG = $logFile
62+
$script:ERR_LOG = $errLogFile
6063
$script:WEB_LOG = $logFile
6164
$script:MOBILE_LOG = $logFile
6265
Log-Line "ℹ️ Log file path: $logFile" $GLOBAL_LOG

0 commit comments

Comments
 (0)