-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Integration Test Suite Resilience (#273)
* Improve Integration Test Suite Resiliency
- Loading branch information
1 parent
990f4af
commit 0e4e79c
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
retries=0 | ||
# Given the resource limitations and external dependencies for the test suite, | ||
# a retry count of at least 10 is needed. | ||
until [ $retries -ge 10 ] | ||
do | ||
echo "Running Test Suite Attempt ($retries)...." | ||
swift test -v | grep -E "Test Case|XCTAssert|failures" | ||
|
||
exit_code=$? | ||
|
||
if [ $exit_code -eq 0 ]; then | ||
echo "Test Succeeded" | ||
break | ||
else | ||
((retries=retries+1)) | ||
echo "Test Suite Failed." | ||
fi | ||
done | ||
|
||
if [ $retries -ge 10 ]; then | ||
echo "Maximum number of retries exceeded. Exiting with status code 1." | ||
exit 1 | ||
fi |