-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrunTests.ps1
36 lines (36 loc) · 1.05 KB
/
runTests.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<#
See CONTRIBUTING.adoc for details
#>
$testNames = @(
"test_noMarkerWithoutPayload"
"test_noMarkerWithPayload"
"test_WithExtId"
"test_WithWaitTimeout"
"test_WithFail"
)
$rootDir = "./src/jstest/act"
$secrets = "$rootDir/.secrets"
$failedTest = $testNames.Length
$testNames | ForEach-Object {
$workflow = "$_.yml"
Write-Host "🛫 Running test workflow $workflow"
act workflow_dispatch -W ".github/workflows/$workflow" --secret-file "$secrets" --pull=false
$resState = ''
if (0 -eq $LASTEXITCODE) {
$resState = '✅'
$failedTest = $failedTest - 1
} else {
$resState = '❌'
}
$msg = "$resState Workflow test $workflow finished with exitcode $LASTEXITCODE $resState"
$reps = [math]::ceiling(($msg.Length - 2 ) / 2) - 1
$border = ($resState * $reps)
$border = $border.SubString(0, [math]::min($msg.Length, $border.Length))
Write-Host ""
Write-Host $border
Write-Host $msg
Write-Host $border
Write-Host ""
}
Write-Host "Summary:"
Write-Host "$failedTest tests failed"