Bug 1146494 - Some optimizations for tools repo CI. r=mgerva FIREFOX_31_6_0esr_BUILD1
authorRail Aliiev <rail@mozilla.com>
Mon, 23 Mar 2015 14:52:49 -0400
changeset 5580 3530a758447a4ecf76fa0ede4d5859dac32611fa
parent 5579 bccc7e1991583441e8044ad072ec9f0494f32431
child 5581 59a91abec256cd5d95bfea8b3788e2d5cadb6e9d
push id4157
push userraliiev@mozilla.com
push dateMon, 23 Mar 2015 18:52:53 +0000
reviewersmgerva
bugs1146494
Bug 1146494 - Some optimizations for tools repo CI. r=mgerva
.travis.yml
lib/python/mozilla_buildtools/test/test_util_hg.py
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,22 +1,27 @@
 language: python
 python:
   - "2.7"
 
+env:
+    - TOX_ENV=py27-hg2.6
+    - TOX_ENV=py26-hg2.6
+    - TOX_ENV=py27-hg3.1
+
 before_script:
   - git config --global user.email "travis@travis-ci.org"
   - git config --global user.name "Travis McTravis"
   - cp lib/python/mozilla_buildtools/test/hgrc ~/.hgrc
 
 install:
   - pip install tox
 
 script:
-  - tox
+  - tox -e $TOX_ENV
 
 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/lib/python/mozilla_buildtools/test/test_util_hg.py
+++ b/lib/python/mozilla_buildtools/test/test_util_hg.py
@@ -94,17 +94,20 @@ class TestIsHgCset(unittest.TestCase):
         self.assertFalse(is_hg_cset('tip'))
 
     def testBranch(self):
         self.assertFalse(is_hg_cset('GECKO77_203512230833_RELBRANCH'))
 
 
 class TestHg(unittest.TestCase):
     def setUp(self):
-        self.tmpdir = tempfile.mkdtemp()
+        tmpdir = None
+        if os.path.isdir("/dev/shm"):
+            tmpdir = "/dev/shm"
+        self.tmpdir = tempfile.mkdtemp(dir=tmpdir)
         self.repodir = os.path.join(self.tmpdir, 'repo')
         run_cmd(['%s/init_hgrepo.sh' % os.path.dirname(__file__),
                 self.repodir])
 
         self.revisions = getRevisions(self.repodir)
         self.wc = os.path.join(self.tmpdir, 'wc')
         self.pwd = os.getcwd()
         self.sleep_patcher = patch('time.sleep')