Skip to content

Commit 5876645

Browse files
authored
Merge pull request #105 from Cysharp/feature/AutomaticUnitTestsRetry
Use dotnet-retest to retry flaky tests
2 parents 4f6f93f + 4264b5d commit 5876645

File tree

3 files changed

+48
-6
lines changed

3 files changed

+48
-6
lines changed

.config/dotnet-tools.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"dotnet-retest": {
6+
"version": "0.6.3",
7+
"commands": [
8+
"dotnet-retest"
9+
],
10+
"rollForward": false
11+
}
12+
}
13+
}

.github/workflows/build-natives.yml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@ on:
33
workflow_dispatch:
44
inputs:
55
build-config:
6+
description: 'Build configuration'
67
required: true
78
default: 'release'
89
type: choice
910
options:
1011
- debug
1112
- release
1213
build-only-linux:
14+
description: 'Build only for Linux'
1315
required: true
1416
default: false
1517
type: boolean
1618
update-unity-native:
19+
description: 'Update pre-built libraries for Unity'
1720
required: true
1821
default: false
1922
type: boolean
@@ -51,7 +54,10 @@ jobs:
5154
name: win-x64
5255
path: native/target/x86_64-pc-windows-msvc/${{ env._RUST_BUILD_CONFIG }}/yaha_native.dll
5356
retention-days: 1
54-
- run: dotnet test -c ${{ env._DOTNET_BUILD_CONFIG }} ../test/YetAnotherHttpHandler.Test
57+
- name: Run tests
58+
run: |
59+
dotnet tool restore
60+
dotnet retest -- -c ${{ env._DOTNET_BUILD_CONFIG }} ../test/YetAnotherHttpHandler.Test
5561
5662
build-win-arm64:
5763
name: Build Native library (win-arm64)
@@ -73,7 +79,10 @@ jobs:
7379
name: win-arm64
7480
path: native/target/aarch64-pc-windows-msvc/${{ env._RUST_BUILD_CONFIG }}/yaha_native.dll
7581
retention-days: 1
76-
#- run: dotnet test -c ${{ env._DOTNET_BUILD_CONFIG }} ../test/YetAnotherHttpHandler.Test
82+
#- name: Run tests
83+
# run: |
84+
# dotnet tool restore
85+
# dotnet retest -- -c ${{ env._DOTNET_BUILD_CONFIG }} ../test/YetAnotherHttpHandler.Test
7786

7887
build-win-arm64-uwp:
7988
name: Build Native library (win-arm64-uwp)
@@ -97,7 +106,10 @@ jobs:
97106
name: win-arm64-uwp
98107
path: native/target/aarch64-uwp-windows-msvc/${{ env._RUST_BUILD_CONFIG }}/yaha_native.dll
99108
retention-days: 1
100-
#- run: dotnet test -c ${{ env._DOTNET_BUILD_CONFIG }} ../test/YetAnotherHttpHandler.Test
109+
#- name: Run tests
110+
# run: |
111+
# dotnet tool restore
112+
# dotnet retest -- -c ${{ env._DOTNET_BUILD_CONFIG }} ../test/YetAnotherHttpHandler.Test
101113

102114
build-linux-x64:
103115
name: Build Native library (linux-x64)
@@ -115,7 +127,10 @@ jobs:
115127
name: linux-x64
116128
path: native/target/x86_64-unknown-linux-gnu/${{ env._RUST_BUILD_CONFIG }}/libyaha_native.so
117129
retention-days: 1
118-
- run: dotnet test -c ${{ env._DOTNET_BUILD_CONFIG }} ../test/YetAnotherHttpHandler.Test
130+
- name: Run tests
131+
run: |
132+
dotnet tool restore
133+
dotnet retest -- -c ${{ env._DOTNET_BUILD_CONFIG }} ../test/YetAnotherHttpHandler.Test
119134
120135
build-osx-x64:
121136
name: Build Native library (osx-x64)
@@ -135,7 +150,10 @@ jobs:
135150
name: osx-x64
136151
path: native/target/x86_64-apple-darwin/${{ env._RUST_BUILD_CONFIG }}/libyaha_native.dylib
137152
retention-days: 1
138-
- run: dotnet test -c ${{ env._DOTNET_BUILD_CONFIG }} ../test/YetAnotherHttpHandler.Test
153+
- name: Run tests
154+
run: |
155+
dotnet tool restore
156+
dotnet retest -- -c ${{ env._DOTNET_BUILD_CONFIG }} ../test/YetAnotherHttpHandler.Test
139157
140158
build-osx-arm64:
141159
name: Build Native library (osx-arm64)
@@ -154,7 +172,10 @@ jobs:
154172
name: osx-arm64
155173
path: native/target/aarch64-apple-darwin/${{ env._RUST_BUILD_CONFIG }}/libyaha_native.dylib
156174
retention-days: 1
157-
- run: dotnet test -c ${{ env._DOTNET_BUILD_CONFIG }} ../test/YetAnotherHttpHandler.Test
175+
- name: Run tests
176+
run: |
177+
dotnet tool restore
178+
dotnet retest -- -c ${{ env._DOTNET_BUILD_CONFIG }} ../test/YetAnotherHttpHandler.Test
158179
159180
build-ios-x64:
160181
name: Build Native library (ios-x64)

YetAnotherHttpHandler.sln

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PerformanceCheck", "perf\Pe
2323
EndProject
2424
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YetAnotherHttpHandler.StandaloneTestServer", "test\YetAnotherHttpHandler.StandaloneTestServer\YetAnotherHttpHandler.StandaloneTestServer.csproj", "{BD7A619A-91BB-48A9-AA79-A9724DB320DD}"
2525
EndProject
26+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub Actions", "GitHub Actions", "{1E0B84D3-2B44-4948-80B8-4D2E2E6D51A3}"
27+
ProjectSection(SolutionItems) = preProject
28+
.github\workflows\build-natives.yml = .github\workflows\build-natives.yml
29+
.github\workflows\build-push-and-pr.yml = .github\workflows\build-push-and-pr.yml
30+
.github\workflows\build-release.yml = .github\workflows\build-release.yml
31+
EndProjectSection
32+
EndProject
2633
Global
2734
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2835
Debug|Any CPU = Debug|Any CPU
@@ -53,6 +60,7 @@ Global
5360
{22CFEF14-D36A-4E21-B51F-F31053C0E870} = {EDDCC9A6-BB1C-4AB9-A0C1-9AD888858442}
5461
{BD12E8F7-E190-4B76-AFF5-62376CF0BD57} = {49D0877D-6B51-4A83-8B93-9DC19BAEABB4}
5562
{BD7A619A-91BB-48A9-AA79-A9724DB320DD} = {EDDCC9A6-BB1C-4AB9-A0C1-9AD888858442}
63+
{1E0B84D3-2B44-4948-80B8-4D2E2E6D51A3} = {9D970D42-0D6A-4483-886F-3003AB62E04C}
5664
EndGlobalSection
5765
GlobalSection(ExtensibilityGlobals) = postSolution
5866
SolutionGuid = {0F200E0E-4EC0-4C1A-BF65-BA52D3291577}

0 commit comments

Comments
 (0)