This commit adds again the Travis function `travis_retry` (https://docs.travis-ci.com/user/common-build-problems/#travis_retry) to all the commands used to execute the E2E tests as they sometimes fail due to factors outside our control and they pass if we retry them manually. See for example this issue for an instance where often times the E2E tests fail, the issue describes a problem that happened in a local environment, but we see the same error happening on Travis as well: https://github.com/woocommerce/woocommerce/issues/27846. I actually just saw it and had to restart a Travis build job manually and that is what prompted me to create this commit. Having Travis retry the command automatically should save us some time when we review PRs as there is a chance the command will pass on a subsequent run and we won't have to retry it manually and wait for it to finish.
We have used this function in the past (see 67b5b270f3), but it got removed in 1658dd3962. But after some conversation about it a couple of weeks ago, we decided to use it again.
By default, Travis uses a depth of 50 when cloning git repositories.
This commit changes the depth to 1. This will make each Travis build
run slightly faster.
In #27977, we added the Travis build job that runs using WP nightly to
the list of jobs that can fail due to a problem in WP itself. Now this
problem was fixed, the build job is passing and we can remove it from
this list.
This commit changes the .travis.yml file to run `npm install` (and two associated commands) only when running the build job that executes the E2E tests. Running `npm install` takes about 160 seconds to complete and, before this commit, we were running it for all build jobs unnecessarily.
This commit adds the Travis build job that runs using WP nightly to the
list of jobs that are allowed to fail. Two days ago a change
(fa5a6c8622) was
introduced to WP nightly that broke hundreds of our unit tests. I'm
suggesting we move this build job to the list of jobs that are allowed
to fail while we work on a fix for this problem either on our side or on
WP core side. Having the build always failing due to a known issue in a yet to be released WP version has the potential to hide other more important failures.
This commit removes a redundant Travis build job that runs unit tests
against PHP 7.2 and the latest version of WP. A build job with the same
characteristics is alredy defined in
3bb94bc23f/.travis.yml (L20)
as if the WP version is not specified, the latest version is used
(3bb94bc23f/.travis.yml (L25)).