mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 06:47:41 +03:00
tests: remove test environment when running system hg
Summary: dynamicconfig has logic to avoid loading remote configs during tests, by checking the TESTTMP variable. Unfortunately, the tests currently run system hg with that environment set, which causes it to generate incorrect configuration for the real repository (i.e. fbsource). Let's get rid of all test specific environment variables when running the system hg. There's a comment in the code saying this breaks some tests (from 2017 03a31be593db), but as far as I can see they still work. Reviewed By: quark-zju Differential Revision: D26758364 fbshipit-source-id: 945cbd36f7eccc98149772a42421cbc51b157c5b
This commit is contained in:
parent
6451219968
commit
752c5ccff5
@ -1467,7 +1467,7 @@ class Test(unittest.TestCase):
|
||||
name_regex = re.compile("^[a-zA-Z][a-zA-Z0-9_]*$")
|
||||
|
||||
# Do not restore these variables; otherwise tests would fail.
|
||||
reqnames = {"PYTHON", "TESTDIR", "TESTTMP"}
|
||||
reqnames = {}
|
||||
|
||||
with open(scriptpath, "w") as envf:
|
||||
for name, value in origenviron.items():
|
||||
|
@ -6,6 +6,6 @@
|
||||
$ cd "$TESTDIR"/..
|
||||
|
||||
$ testrepohg files . > $TESTTMP/filelist
|
||||
$ testrepohgenv; PYTHONPATH= ./contrib/fix-code.py --dry-run `cat $TESTTMP/filelist`
|
||||
$ PYTHONPATH= ./contrib/fix-code.py --dry-run `cat $TESTTMP/filelist`
|
||||
# In case the above list is not empty, run 'contrib/fix-code.py FILE...' to
|
||||
# fix them.
|
||||
|
Loading…
Reference in New Issue
Block a user