-
Notifications
You must be signed in to change notification settings - Fork 782
127 lines (107 loc) · 3.69 KB
/
Copy pathstress-tests.yml
File metadata and controls
127 lines (107 loc) · 3.69 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Run StressTests (for 15 minutes)
on:
schedule:
- cron: '0 0 * * *' # Runs every day at midnight UTC
push:
branches: [ main, develop ]
paths-ignore:
- '**.md'
jobs:
run_stress_tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
timeout-minutes: 70 # Allow some buffer time beyond the 1-hour test duration
env:
DisableRealDriverIO: "1"
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0 # GitVersion.MsBuild needs full history
- name: Setup .NET Core
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x
dotnet-quality: 'ga'
- name: Install dependencies
run: dotnet restore
- name: Build StressTests
run: dotnet build Tests/StressTests --configuration Debug --no-restore
- name: Run StressTests for 15 minutes
run: |
end=$((SECONDS+900))
while [ $SECONDS -lt $end ]; do
dotnet test --project Tests/StressTests --no-build --verbosity normal --diagnostic --diagnostic-output-directory logs/${{ runner.os }}
done
- name: Upload Test Logs
if: always()
uses: actions/upload-artifact@v7
with:
name: stress-test-logs-${{ runner.os }}
path: |
logs/
TestResults/StressTests
parallel_unittests_stress:
name: Parallel Unit Tests Stress (3 iterations)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
timeout-minutes: 90
env:
DisableRealDriverIO: "1"
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0 # GitVersion.MsBuild needs full history
- name: Setup .NET Core
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x
dotnet-quality: 'ga'
- name: Install dependencies
run: dotnet restore
- name: Build UnitTestsParallelizable
run: dotnet build Tests/UnitTestsParallelizable --configuration Debug --no-restore
- name: Disable Windows Defender (Windows only)
if: runner.os == 'Windows'
shell: powershell
run: |
Add-MpPreference -ExclusionPath "${{ github.workspace }}"
Add-MpPreference -ExclusionProcess "dotnet.exe"
- name: Run UnitTestsParallelizable (3 iterations)
shell: bash
run: |
# Run tests 3 times to expose concurrency issues
for RUN in {1..3}; do
echo "============================================"
echo "Starting test run $RUN of 3"
echo "============================================"
dotnet test \
--project Tests/UnitTestsParallelizable \
--no-build \
--verbosity normal \
--diagnostic --diagnostic-output-directory logs/UnitTestsParallelizable/${{ runner.os }}/run${RUN}
if [ $? -ne 0 ]; then
echo "ERROR: Test run $RUN failed!"
exit 1
fi
echo "Test run $RUN completed successfully"
echo ""
done
echo "============================================"
echo "All 3 test runs completed successfully!"
echo "============================================"
- name: Upload UnitTestsParallelizable Logs
if: always()
uses: actions/upload-artifact@v7
with:
name: parallel_unittests_stress-logs-${{ runner.os }}
path: |
logs/UnitTestsParallelizable/
TestResults/