You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2020/01/06 10:36:39 UTC

svn commit: r1872372 - /httpd/httpd/trunk/test/travis_before_linux.sh

Author: jorton
Date: Mon Jan  6 10:36:39 2020
New Revision: 1872372

URL: http://svn.apache.org/viewvc?rev=1872372&view=rev
Log:
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

Modified:
    httpd/httpd/trunk/test/travis_before_linux.sh

Modified: httpd/httpd/trunk/test/travis_before_linux.sh
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/test/travis_before_linux.sh?rev=1872372&r1=1872371&r2=1872372&view=diff
==============================================================================
--- httpd/httpd/trunk/test/travis_before_linux.sh (original)
+++ httpd/httpd/trunk/test/travis_before_linux.sh Mon Jan  6 10:36:39 2020
@@ -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