1
1
param (
2
- [Parameter ()][string ]$coyoteVersion = " 1.7.10 " ,
2
+ [Parameter ()][string ]$coyoteVersion = " 1.7.11 " ,
3
3
[Parameter (Mandatory = $true )][string ]$testProjectName ,
4
4
[Parameter (Mandatory = $true )][string ]$targetFramework ,
5
5
[Parameter ()][string ]$categoryName = " CoyoteConcurrencyTests" ,
6
6
[Parameter ()][string ]$configuration = " Release"
7
7
)
8
8
9
+ $ErrorActionPreference = " Stop"
10
+
9
11
$env: OTEL_RUN_COYOTE_TESTS = ' true'
10
12
11
13
$rootDirectory = Get-Location
12
14
13
15
Write-Host " Install Coyote CLI."
14
- dotnet tool install -- global Microsoft.Coyote.CLI
16
+ dotnet tool install -- global Microsoft.Coyote.CLI -- version $coyoteVersion
17
+
18
+ if ($LASTEXITCODE -ne 0 ) {
19
+ throw " Microsoft.Coyote.CLI installation failed with exit code $LASTEXITCODE "
20
+ }
15
21
16
22
Write-Host " Build $testProjectName project."
17
23
dotnet build " $rootDirectory /test/$testProjectName /$testProjectName .csproj" -- configuration $configuration
18
24
25
+ if ($LASTEXITCODE -ne 0 ) {
26
+ throw " dotnet build failed with exit code $LASTEXITCODE "
27
+ }
28
+
19
29
$artifactsPath = Join-Path $rootDirectory " test/$testProjectName /bin/$configuration /$targetFramework "
20
30
21
31
Write-Host " Generate Coyote rewriting options JSON file."
@@ -29,6 +39,13 @@ $RewriteOptionsJson | ConvertTo-Json -Compress | Set-Content -Path "$rootDirecto
29
39
Write-Host " Run Coyote rewrite."
30
40
coyote rewrite " $rootDirectory /test/$testProjectName /rewrite.coyote.json"
31
41
42
+ if ($LASTEXITCODE -ne 0 ) {
43
+ throw " coyote rewrite failed with exit code $LASTEXITCODE "
44
+ }
45
+
32
46
Write-Host " Execute re-written binary."
33
47
dotnet test " $artifactsPath /$testProjectName .dll" -- framework $targetFramework -- filter CategoryName= $categoryName
34
48
49
+ if ($LASTEXITCODE -ne 0 ) {
50
+ throw " dotnet test failed with exit code $LASTEXITCODE "
51
+ }
0 commit comments