diff options
author | Joe Orton <jorton@apache.org> | 2020-01-06 11:36:39 +0100 |
---|---|---|
committer | Joe Orton <jorton@apache.org> | 2020-01-06 11:36:39 +0100 |
commit | ff26c75f331d2eb13e30649123cd882e4ffb379b (patch) | |
tree | d1fbea1cc690af38bdf8f4659fc5f8a260276ba4 | |
parent | test/travis_before_linux.sh: increase backoff time before executing svn export (diff) | |
download | apache2-ff26c75f331d2eb13e30649123cd882e4ffb379b.tar.xz apache2-ff26c75f331d2eb13e30649123cd882e4ffb379b.zip |
Cache SVN checkout of test/framework across Travis builds. Should
improve reliability (the checkout fails frequently) and performance,
plus reduces load on ASF infra.
Github: closes #85
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1872372 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-x | test/travis_before_linux.sh | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/test/travis_before_linux.sh b/test/travis_before_linux.sh index d1a9f61845..0a8e056d46 100755 --- a/test/travis_before_linux.sh +++ b/test/travis_before_linux.sh @@ -9,15 +9,16 @@ fi # reporting any progress. function run_svn_export() { local url=$1 - local dest_dir=$2 - local max_tries=$3 + local revision=$2 + local dest_dir=$3 + local max_tries=$4 # Disable -e to allow fail/retry set +e for i in $(seq 1 $max_tries) do - timeout 60 svn export --force -q $url $dest_dir + timeout 60 svn export -r ${revision} --force -q $url $dest_dir if [ $? -eq 0 ]; then break else @@ -71,7 +72,23 @@ function install_apx() { if ! test -v SKIP_TESTING; then - run_svn_export https://svn.apache.org/repos/asf/httpd/test/framework/trunk test/perl-framework 5 + # The test/framework checkout is cached at ~/root/framework, which + # is copied to test/framework within the httpd build directory. + # Renew the cache here if the last-changed revision is stale. + framework=https://svn.apache.org/repos/asf/httpd/test/framework/trunk + fcache=$HOME/root/framework + frev=`svn info --no-newline --show-item last-changed-revision ${framework}` + if [ -d ${fcache} -a ! -f ${fcache}/.revision-is-${frev} ]; then + : Purging stale cache at ${fcache} + rm -rf ${fcache} + fi + + if [ ! -d ${fcache} ]; then + run_svn_export ${framework} ${frev} ${fcache} 5 + touch ${fcache}/.revision-is-${frev} + fi + + cp -a ${fcache} test/perl-framework fi if test -v APR_VERSION; then |