test(deploy): implement strict HTTP deployment verification script
This commit is contained in:
1 parent
6024579a19
commit
ccc268d807
2 files changed
+30
-2
No files matched your search
@@ -106,6 +106,10 @@ start:
|
|||||||
Write-Host "Starting MCP server in background..." -ForegroundColor Cyan
|
Write-Host "Starting MCP server in background..." -ForegroundColor Cyan
|
||||||
Start-Process -WindowStyle Hidden -FilePath mcp-memory-server
|
Start-Process -WindowStyle Hidden -FilePath mcp-memory-server
|
||||||
|
|
||||||
# Restart the server
|
# Verify the deployment is healthy and serving correct content
|
||||||
restart: stop start
|
verify:
|
||||||
|
pwsh.exe -NoProfile -File verify_deployment.ps1
|
||||||
|
|
||||||
|
# Restart the server and verify
|
||||||
|
restart: stop start verify
|
||||||
|
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
$Url = "http://127.0.0.1:3000/"
|
||||||
|
$ExpectedContent = "open-color" # Basic sanity check that we are serving the updated UI
|
||||||
|
|
||||||
|
Write-Host "Verifying server at $Url..." -ForegroundColor Cyan
|
||||||
|
|
||||||
|
for ($i = 1; $i -le 10; $i++) {
|
||||||
|
try {
|
||||||
|
$response = Invoke-WebRequest -Uri $Url -UseBasicParsing -ErrorAction Stop
|
||||||
|
if ($response.StatusCode -eq 200) {
|
||||||
|
if ($response.Content -match $ExpectedContent) {
|
||||||
|
Write-Host "✅ Server is UP and serving the correct payload! (Attempt $i)" -ForegroundColor Green
|
||||||
|
exit 0
|
||||||
|
} else {
|
||||||
|
Write-Host "⚠️ Server is up but serving old cached content. Retrying... (Attempt $i)" -ForegroundColor Yellow
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Write-Host "⏳ Server not responding yet... (Attempt $i)" -ForegroundColor Yellow
|
||||||
|
}
|
||||||
|
Start-Sleep -Seconds 1
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Error "❌ Deployment verification failed! Server did not come up or did not serve correct content after 10 seconds."
|
||||||
|
exit 1
|
||||||
Reference in new issue
Block a user