Patchwork [4,of,5] run-tests: install hg after computing tests to run

login
register
mail settings
Submitter Siddharth Agarwal
Date June 6, 2017, 9:39 p.m.
Message ID <29aaeed22502929559e1.1496785167@devvm31800.prn1.facebook.com>
Download mbox | patch
Permalink /patch/21229/
State Accepted
Headers show

Comments

Siddharth Agarwal - June 6, 2017, 9:39 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1496782613 25200
#      Tue Jun 06 13:56:53 2017 -0700
# Node ID 29aaeed22502929559e1e85d8fb0c1ed6433ecba
# Parent  cd0fe3fedddab358d47d6f34d5c1e596298199bb
run-tests: install hg after computing tests to run

We're going to add a way to list tests, and we don't need to install hg for
that.

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -2347,15 +2347,6 @@  class TestRunner(object):
             return self._gettest(desc, i)
 
         try:
-            if self._installdir:
-                self._installhg()
-                self._checkhglib("Testing")
-            else:
-                self._usecorrectpython()
-            if self.options.chg:
-                assert self._installdir
-                self._installchg()
-
             if self.options.restart:
                 orig = list(testdescs)
                 while testdescs:
@@ -2393,6 +2384,16 @@  class TestRunner(object):
             if self.options.verbose:
                 verbosity = 2
             runner = TextTestRunner(self, verbosity=verbosity)
+
+            if self._installdir:
+                self._installhg()
+                self._checkhglib("Testing")
+            else:
+                self._usecorrectpython()
+            if self.options.chg:
+                assert self._installdir
+                self._installchg()
+
             result = runner.run(suite)
 
             if result.failures: