From 629c76c31bef20205f1fd02f81d2cdd2fb073bd4 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sat, 15 Sep 2018 09:21:55 +0000 Subject: [PATCH] Build/Test Tools: Implement the automatic retry functionality that Travis CI provides. This functionality will cause the command to be retried up to three times in case of a non-zero return value. Implementing it on commands that perform network requests means that intermittent network failures are less likely to cause a build to fail, as they'll be retried up to three times. See #44858 git-svn-id: https://develop.svn.wordpress.org/trunk@43645 602fd350-edb4-49c9-b593-d223f7449a82 --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index ec458a3691..49d2d67274 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,7 @@ before_install: sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php sed -i "s/yourusernamehere/root/" wp-tests-config.php sed -i "s/yourpasswordhere//" wp-tests-config.php - svn checkout https://plugins.svn.wordpress.org/wordpress-importer/tags/0.6.3/ tests/phpunit/data/plugins/wordpress-importer + travis_retry svn checkout https://plugins.svn.wordpress.org/wordpress-importer/tags/0.6.3/ tests/phpunit/data/plugins/wordpress-importer fi - | if [[ "$WP_TRAVIS_OBJECT_CACHE" == "true" ]]; then @@ -68,11 +68,11 @@ before_script: case "$TRAVIS_PHP_VERSION" in 7.2|7.1|7.0|nightly) echo "Using PHPUnit 6.x" - composer global require "phpunit/phpunit:^6" + travis_retry composer global require "phpunit/phpunit:^6" ;; 5.6|5.5|5.4|5.3) echo "Using PHPUnit 4.x" - composer global require "phpunit/phpunit:^4" + travis_retry composer global require "phpunit/phpunit:^4" ;; 5.2) # Do nothing, use default PHPUnit 3.6.x @@ -88,7 +88,7 @@ before_script: # We only need to run composer install on the code formatting job. if [[ "$WP_TRAVISCI" == "travis:format" ]]; then composer --version - composer install + travis_retry composer install fi - npm --version - node --version