Bug 1148966 - Use container based travis CI to improve test wait times. r=Callek
authorRail Aliiev <rail@mozilla.com>
Mon, 30 Mar 2015 03:51:38 -0400
changeset 4163 6c2b489f2866731afc7f45f7d91cf29acc33da74
parent 4162 ccba2a403d0eff2c3aa8111b6d24da9585abe6da
child 4165 f429fd5ac7a6c3070b3881ea903f88f75aed98d9
child 4167 adf6052198a4c248c8a7b05bf4e64a57df8ee48d
push id3467
push userraliiev@mozilla.com
push dateMon, 30 Mar 2015 07:52:00 +0000
reviewersCallek
bugs1148966
Bug 1148966 - Use container based travis CI to improve test wait times. r=Callek
.travis.yml
tox_env.sh
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,17 +1,31 @@
 language: python
 python:
   - "2.7"
 
+sudo: false
+
+env:
+  global:
+    - PIP_FIND_LINKS=file://$HOME/.cache/pip
+    - PIP_CACHE_DIR=$HOME/.cache/pip
+
+cache:
+  directories:
+    - $HOME/.cache/pip
+    - $TRAVIS_BUILD_DIR/.tox
+
 install:
   - pip install tox
 
 script:
   - tox
+  # Remove logs to avoid cache uploads
+  - rm -rf $HOME/.cache/pip/log
 
 after_script:
   - tox -e py27-coveralls
 
 # currently cannot customise per user fork, see:
 # https://github.com/travis-ci/travis-ci/issues/1094
 # please comment out this section in your personal fork!
 notifications:
--- a/tox_env.sh
+++ b/tox_env.sh
@@ -3,17 +3,17 @@
 TOX_DIR="${1}"
 
 function hgme {
     repo="${1}"
     if [ ! -d "${TOX_DIR}/${repo}" ]; then
         hg clone https://hg.mozilla.org/build/${repo} "${TOX_DIR}/${repo}"
     else
         # this is equivalent to hg purge but doesn't require the hg purge plugin to be enabled
-        hg status -un0 -R "${TOX_DIR}/${repo}" | xargs rm -rf
+        hg status -un0 -R "${TOX_DIR}/${repo}" | xargs --no-run-if-empty --null rm -rf
         hg pull -u -R "${TOX_DIR}/${repo}"
     fi
 }
 
 hgme tools
 hgme buildbot
 
 # top level dir has a __init__.py so the package name is the same as the directory