25 lines
734 B
PowerShell
25 lines
734 B
PowerShell
$ErrorActionPreference = 'Stop'
|
|||
|
|
|
||
|
|
Write-Host 'Running Go tests...'
|
||
|
|
go test ./...
|
||
|
|
go vet ./...
|
||
|
|
|
||
|
|
$artifact = Join-Path (Get-Location) 'build/chub.exe'
|
||
|
|
Write-Host 'Building Windows artifact...'
|
||
|
|
go build -o $artifact ./cmd/chub
|
||
|
|
if (-not (Test-Path -LiteralPath $artifact)) {
|
||
|
|
throw "artifact was not created: $artifact"
|
||
|
|
}
|
||
|
|
|
||
|
|
Write-Host 'Checking CLI JSON contract...'
|
||
|
|
$list = & $artifact list
|
||
|
|
if ($LASTEXITCODE -ne 0 -or $list -notmatch '"instances"') {
|
||
|
|
throw "list command did not return the expected JSON contract"
|
||
|
|
}
|
||
|
|
$events = & $artifact events
|
||
|
|
if ($LASTEXITCODE -ne 0 -or $events -notmatch 'browser.snapshot') {
|
||
|
|
throw "events command did not return the expected local snapshot"
|
||
|
|
}
|
||
|
|
|
||
|
|
Write-Host "Windows smoke passed: $artifact"
|