Skip to content

Commit bc42e97

Browse files
authored
Improve test execution error handling in workflows (#312)
+semver:patch
1 parent f25188b commit bc42e97

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

.github/workflows/dotnet-linux.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ jobs:
5454

5555
- name: Run tests
5656
run: |
57-
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.Tests
58-
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.Tests.VB
59-
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.EntityFramework.Tests
60-
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.EntityFrameworkCore8.Tests
61-
dotnet test --no-build -c Release -f net9.0 src/DelegateDecompiler.EntityFrameworkCore9.Tests
62-
dotnet test --no-build -c Release -f net10.0 src\DelegateDecompiler.EntityFrameworkCore10.Tests
57+
$failed = $false
58+
function Fail { $script:failed = $true }
59+
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.Tests || Fail
60+
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.Tests.VB || Fail
61+
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.EntityFramework.Tests || Fail
62+
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.EntityFrameworkCore8.Tests || Fail
63+
dotnet test --no-build -c Release -f net9.0 src/DelegateDecompiler.EntityFrameworkCore9.Tests || Fail
64+
dotnet test --no-build -c Release -f net10.0 src/DelegateDecompiler.EntityFrameworkCore10.Tests || Fail
65+
if ($failed) { exit 1 }

.github/workflows/dotnet-windows.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@ jobs:
4848

4949
- name: Run tests
5050
run: |
51-
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.Tests
52-
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.Tests.VB
53-
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.EntityFramework.Tests
54-
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.EntityFrameworkCore8.Tests
55-
dotnet test --no-build -c Release -f net9.0 src/DelegateDecompiler.EntityFrameworkCore9.Tests
56-
dotnet test --no-build -c Release -f net10.0 src\DelegateDecompiler.EntityFrameworkCore10.Tests
51+
$failed = $false
52+
function Fail { $script:failed = $true }
53+
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.Tests || Fail
54+
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.Tests.VB || Fail
55+
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.EntityFramework.Tests || Fail
56+
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.EntityFrameworkCore8.Tests || Fail
57+
dotnet test --no-build -c Release -f net9.0 src/DelegateDecompiler.EntityFrameworkCore9.Tests || Fail
58+
dotnet test --no-build -c Release -f net10.0 src/DelegateDecompiler.EntityFrameworkCore10.Tests || Fail
59+
if ($failed) { exit 1 }

src/DelegateDecompiler.Tests/StackOverflowTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void StackOverflowTestOnThreadWithLargeStack()
5656
thread.Join();
5757
}
5858

59-
[Test]
59+
[Test, Explicit]
6060
public void StackOverflowTestOnThreadWithSmallStack()
6161
{
6262
Thread thread = new Thread(() =>

0 commit comments

Comments
 (0)