Publish curated ITWorx-Pulse source from 0e0633c8ac91cb71312a26837f791035a78d81b8
Public source validation / validate (push) Failing after 2m10s
Public source validation / validate (push) Failing after 2m10s
This commit is contained in:
1 parent
a4956c2af9
commit
db8093b608
88 files changed
+3685
-469
No files matched your search
@@ -9,8 +9,10 @@ function Get-FreeLoopbackPort {
|
||||
}
|
||||
|
||||
if (-not (Get-Command docker -ErrorAction SilentlyContinue)) { throw 'Docker is required for the isolated integration smoke.' }
|
||||
$goBin = Join-Path $env:LOCALAPPDATA 'ITWorx-Pulse\toolchains\go1.26.6\bin'
|
||||
if (-not (Get-Command go -ErrorAction SilentlyContinue) -and (Test-Path (Join-Path $goBin 'go.exe'))) { $env:PATH = $goBin + ';' + $env:PATH }
|
||||
if (-not (Get-Command go -ErrorAction SilentlyContinue) -and $env:LOCALAPPDATA) {
|
||||
$goBin = Join-Path $env:LOCALAPPDATA 'ITWorx-Pulse\toolchains\go1.26.6\bin'
|
||||
if (Test-Path (Join-Path $goBin 'go.exe')) { $env:PATH = $goBin + [IO.Path]::PathSeparator + $env:PATH }
|
||||
}
|
||||
|
||||
$project = 'itworx-pulse-smoke-' + $PID
|
||||
$webPort = Get-FreeLoopbackPort
|
||||
@@ -19,6 +21,8 @@ $dbPort = Get-FreeLoopbackPort
|
||||
$baseURL = "http://127.0.0.1:$webPort"
|
||||
$compose = @('-p', $project, '-f', 'deploy/compose.yaml', '-f', 'deploy/compose.dev.yaml', '-f', 'deploy/compose.smoke.yaml')
|
||||
$succeeded = $false
|
||||
$runnerContainer = [System.Net.Dns]::GetHostName()
|
||||
$runnerNetwork = $null
|
||||
|
||||
$env:PULSE_POSTGRES_PASSWORD = 'smoke-process-only'
|
||||
$env:PULSE_DATABASE_URL = 'postgres://pulse:smoke-process-only@pulse-postgres:5432/pulse?sslmode=disable'
|
||||
@@ -101,6 +105,31 @@ SET observed_at=EXCLUDED.observed_at,received_at=EXCLUDED.received_at,payload=EX
|
||||
'@ | docker compose @compose exec -T pulse-postgres psql -v ON_ERROR_STOP=1 -U pulse -d pulse | Out-Null
|
||||
if ($LASTEXITCODE -ne 0) { throw 'failed to seed bounded container agent snapshot' }
|
||||
docker compose @compose up -d --wait --wait-timeout 240
|
||||
$runnerIsContainer = $false
|
||||
try {
|
||||
docker inspect $runnerContainer *> $null
|
||||
$runnerIsContainer = $LASTEXITCODE -eq 0
|
||||
} catch {
|
||||
# A native workstation runner is expected not to be a Docker object.
|
||||
}
|
||||
if ($runnerIsContainer) {
|
||||
$runnerNetwork = "${project}_pulse-edge"
|
||||
docker network connect $runnerNetwork $runnerContainer
|
||||
$baseURL = 'http://pulse-web:8080'
|
||||
}
|
||||
# Container health can become green just before the runner can reach a newly
|
||||
# published port. Gate the browser-facing path itself to avoid that race.
|
||||
$webReady = $false
|
||||
for ($attempt = 0; $attempt -lt 30; $attempt++) {
|
||||
try {
|
||||
$health = Invoke-WebRequest -Uri "$baseURL/healthz" -TimeoutSec 2
|
||||
if ($health.StatusCode -eq 200 -and $health.Content.Trim() -eq 'ok') { $webReady = $true; break }
|
||||
} catch {
|
||||
# Retry only within this bounded readiness window.
|
||||
}
|
||||
Start-Sleep -Seconds 1
|
||||
}
|
||||
if (-not $webReady) { throw "runner-reachable web endpoint did not become ready: $baseURL" }
|
||||
$inventoryReady = $false
|
||||
for ($attempt = 0; $attempt -lt 30; $attempt++) {
|
||||
Start-Sleep -Seconds 2
|
||||
@@ -170,6 +199,9 @@ SET observed_at=EXCLUDED.observed_at,received_at=EXCLUDED.received_at,payload=EX
|
||||
# The project name is unique to this process. `-v` removes only the empty or
|
||||
# smoke-populated volume created above; no pre-existing Docker object can
|
||||
# match or be referenced by this compose project.
|
||||
if ($runnerNetwork) {
|
||||
try { docker network disconnect $runnerNetwork $runnerContainer 2>$null | Out-Null } catch { }
|
||||
}
|
||||
docker compose @compose down --volumes --remove-orphans 2>$null
|
||||
Remove-Item Env:PULSE_POSTGRES_PASSWORD,Env:PULSE_DATABASE_URL,Env:PULSE_ENV,Env:PULSE_AUTH_MODE,Env:PULSE_SESSION_IDLE_TTL,Env:PULSE_SESSION_ABSOLUTE_TTL,Env:PULSE_DEV_WEB_PORT,Env:PULSE_DEV_API_PORT,Env:PULSE_DEV_DB_PORT,Env:PULSE_SMOKE_WEBHOOK_TOKEN,Env:PULSE_E2E_REAL_BASE_URL -ErrorAction SilentlyContinue
|
||||
}
|
||||
Reference in new issue
Block a user