Skip to content

Commit 0fb32f1

Browse files
committed
Check if threshold mechanism is working: use the threshold higher than the total test number to make the CI fail.
1 parent 8cd50a5 commit 0fb32f1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.azure/pipelines/components-e2e-tests.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ jobs:
7777
7878
exit 1
7979
fi
80+
81+
# Check total tests run to detect abnormalities. In case the number of tests changes significantly, we should adjust the threshold.
82+
# Extract total from the summary line "Failed: xx, Passed: yy, Skipped: zz, Total: NNN, Duration: ..."
83+
total=$(sed -nE 's/.*Failed:[[:space:]]*[0-9]+,[[:space:]]*Passed:[[:space:]]*[0-9]+,[[:space:]]*Skipped:[[:space:]]*[0-9]+,[[:space:]]*Total:[[:space:]]*([0-9]+).*/\1/p' e2e-test-output.log)
84+
min_total=2000
85+
if [ -z "$total" ] || [ "$total" -lt "$min_total" ]
86+
then
87+
echo "##vso[task.logissue type=error] Insufficient total test count: $total. We expect at least $min_total tests to run."
88+
exit 1
89+
fi
8090
displayName: Run E2E tests
8191
- script: .dotnet/dotnet test ./src/Components/test/E2ETest -c $(BuildConfiguration) --no-build --filter 'Quarantined=true' -p:RunQuarantinedTests=true
8292
-p:VsTestUseMSBuildOutput=false

0 commit comments

Comments
 (0)