Skip to content

Commit

Permalink
just wait for 2 min
Browse files Browse the repository at this point in the history
  • Loading branch information
chottuthejimmy committed Feb 14, 2025
1 parent 8bd4c63 commit 5385ca1
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/testdriver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,22 @@ jobs:
echo "starting npm server"
npm start
}
echo "waiting for port to be live"
$portLive = $false
$targetUrl = "${{ env.LOCALHOST }}"
Write-Output "Beginning port checks for $targetUrl"
# echo "waiting for port to be live"
# $portLive = $false
# $targetUrl = "${{ env.LOCALHOST }}"
# Write-Output "Beginning port checks for $targetUrl"
while (-not $portLive) {
$response = Invoke-WebRequest -Uri $targetUrl -Method Head -UseBasicParsing -TimeoutSec 2 -ErrorAction Stop
if ($response.StatusCode -eq 200 -or $response.StatusCode -eq 404) {
$portLive = $true
Write-Output "Port is live (HTTP 200)"
} else {
Write-Output "Port is not live (HTTP $($response.StatusCode))"
Start-Sleep -Seconds 1
}
}
# while (-not $portLive) {
# $response = Invoke-WebRequest -Uri $targetUrl -Method Head -UseBasicParsing -TimeoutSec 2 -ErrorAction Stop
# if ($response.StatusCode -eq 200 -or $response.StatusCode -eq 404) {
# $portLive = $true
# Write-Output "Port is live (HTTP 200)"
# } else {
# Write-Output "Port is not live (HTTP $($response.StatusCode))"
# Start-Sleep -Seconds 1
# }
# }
Start-Sleep -Minutes 2
Write-Output "Starting Chrome"
Start-Process "C:/Program Files/Google/Chrome/Application/chrome.exe" -ArgumentList "--start-maximized", "--load-extension=$(pwd)/node_modules/dashcam-chrome/build", "${{ env.LOCALHOST }}"
Expand Down

0 comments on commit 5385ca1

Please sign in to comment.