Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions .github/workflows/test-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,56 +290,56 @@ jobs:
)

$overallFailed = $false
$logRoot = Join-Path $env:TEMP "now-tests"
New-Item -ItemType Directory -Force -Path $logRoot | Out-Null
$logPath = Join-Path $logRoot "run_test_app_nodejs.log"

Write-Host "================================"
Write-Host "Testing: $scriptPath --silent app nodejs"
Write-Host "================================"

& $scriptPath --silent app nodejs 2>&1 | Tee-Object -FilePath $logPath -Append
$exitCode = $LASTEXITCODE

if ($exitCode -eq 0) {
Write-Host "✅ app / nodejs completed (exit code: $exitCode)"
} else {
Write-Host "⚠️ app / nodejs exited with code: $exitCode"
if (Test-Path $logPath) {
Write-Host "Log output (last 20 lines):"
Get-Content -Path $logPath -Tail 20
}
exit 1
}

# $logRoot = Join-Path $env:TEMP "now-tests"
# New-Item -ItemType Directory -Force -Path $logRoot | Out-Null
# $logPath = Join-Path $logRoot "run_test_app_nodejs.log"

# Write-Host "================================"
# Write-Host "Testing: $scriptPath --silent app nodejs"
# Write-Host "================================"

# & $scriptPath --silent app nodejs 2>&1 | Tee-Object -FilePath $logPath -Append
# $exitCode = $LASTEXITCODE

# if ($exitCode -eq 0) {
# Write-Host "✅ app / nodejs completed (exit code: $exitCode)"
# } else {
# Write-Host "⚠️ app / nodejs exited with code: $exitCode"
# if (Test-Path $logPath) {
# Write-Host "Log output (last 20 lines):"
# Get-Content -Path $logPath -Tail 20
# }
# exit 1
# }

# foreach ($config in $testConfigs) {
# $testType = $config[0]
# $techStack = $config[1]
$logRoot = Join-Path $env:TEMP "now-tests"
New-Item -ItemType Directory -Force -Path $logRoot | Out-Null

# Write-Host "================================"
# Write-Host "Testing: $scriptPath --silent $testType $techStack"
# Write-Host "================================"
foreach ($config in $testConfigs) {
$testType = $config[0]
$techStack = $config[1]

# $logPath = Join-Path $logRoot "run_test_${testType}_${techStack}.log"
Write-Host "================================"
Write-Host "Testing: $scriptPath --silent $testType $techStack"
Write-Host "================================"

# & $scriptPath --silent $testType $techStack 2>&1 | Tee-Object -FilePath $logPath -Append
# $exitCode = $LASTEXITCODE
$logPath = Join-Path $logRoot "run_test_${testType}_${techStack}.log"

# if ($exitCode -eq 0) {
# Write-Host "✅ $testType / $techStack completed (exit code: $exitCode)"
# } else {
# Write-Host "⚠️ $testType / $techStack exited with code: $exitCode"
# $overallFailed = $true
& $scriptPath --silent $testType $techStack 2>&1 | Tee-Object -FilePath $logPath -Append
$exitCode = $LASTEXITCODE

# if (Test-Path $logPath) {
# Write-Host "Log output (last 20 lines):"
# Get-Content -Path $logPath -Tail 20
# }
# }
# }
if ($exitCode -eq 0) {
Write-Host "✅ $testType / $techStack completed (exit code: $exitCode)"
} else {
Write-Host "⚠️ $testType / $techStack exited with code: $exitCode"
$overallFailed = $true

if (Test-Path $logPath) {
Write-Host "Log output (last 20 lines):"
Get-Content -Path $logPath -Tail 20
}
}
}

if ($overallFailed) {
Write-Error "One or more configurations failed."
Expand Down
2 changes: 1 addition & 1 deletion win/common-utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function Invoke-External {
}

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

[void]$p.Start()
$p.BeginOutputReadLine()
Expand Down
3 changes: 3 additions & 0 deletions win/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,16 @@ try {

# Setup log file path AFTER selections
$logFileName = "{0}_{1}_run_result.log" -f $TEST_TYPE.ToLowerInvariant(), $TECH_STACK.ToLowerInvariant()
$errLogFileName = "{0}_{1}_run_result.err" -f $TEST_TYPE.ToLowerInvariant(), $TECH_STACK.ToLowerInvariant()
$logFile = Join-Path $LOG_DIR $logFileName
$errLogFile = Join-Path $env:TEMP $errLogFileName
if (!(Test-Path $LOG_DIR)) {
New-Item -ItemType Directory -Path $LOG_DIR -Force | Out-Null
}
'' | Out-File -FilePath $logFile -Encoding UTF8
Set-RunLogFile $logFile
$script:GLOBAL_LOG = $logFile
$script:ERR_LOG = $errLogFile
$script:WEB_LOG = $logFile
$script:MOBILE_LOG = $logFile
Log-Line "ℹ️ Log file path: $logFile" $GLOBAL_LOG
Expand Down
Loading