diff tests/helpers-testrepo.sh @ 33126:98e2c78e309c

tests: more completely restore the environment in syshgenv Update the syshgenv function to attempt to completely restore the original environment, rather than only updating a few specific variables. run_tests.py now generates a shell script that can be used to restore the original environment, and syshgenv sources it. This is a bit more complicated than the previous code, but should do a better job of running the system hg in the correct environment. I've tested it on Linux using python 2.x, but let me know if it causes issues in other environments. I'm not terribly familiar with how the tests get run on Windows, for instance, and how the environment needs to be updated there.
author Adam Simpkins <simpkins@fb.com>
date Wed, 28 Jun 2017 12:23:22 -0700
parents acfce52518c4
children ddd65b4f3ae6
line wrap: on
line diff
--- a/tests/helpers-testrepo.sh	Wed Jun 28 13:45:51 2017 -0700
+++ b/tests/helpers-testrepo.sh	Wed Jun 28 12:23:22 2017 -0700
@@ -18,10 +18,7 @@
 # Revert the environment so that running "hg" runs the system hg
 # rather than the test hg installation.
 syshgenv () {
-    PATH="$ORIG_PATH"
-    PYTHONPATH="$ORIG_PYTHONPATH"
-    JYTHONPATH="$ORIG_JYTHONPATH"
-    unset HGRCPATH
+    . "$HGTEST_RESTOREENV"
     HGPLAIN=1
     export HGPLAIN
 }