From 7f1673596fcbc5e987cfeef32c021a5a73b429e2 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 2 Aug 2019 16:49:50 -0600 Subject: [PATCH 1/3] Pass the whole parent environment down to the child You never know what is in here that is totally essential to the operation of some random thing. :( --- integration/conftest.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/integration/conftest.py b/integration/conftest.py index 98091c7ce..06ab51655 100644 --- a/integration/conftest.py +++ b/integration/conftest.py @@ -3,7 +3,7 @@ from __future__ import print_function import sys import shutil from time import sleep -from os import mkdir, listdir +from os import mkdir, listdir, environ from os.path import join, exists from tempfile import mkdtemp, mktemp from functools import partial @@ -467,7 +467,8 @@ def chutney(reactor, temp_dir): '/usr/bin/git', 'clone', '--depth=1', 'https://git.torproject.org/chutney.git', chutney_dir, - ) + ), + env=environ, ) pytest_twisted.blockon(proto.done) return chutney_dir @@ -483,6 +484,8 @@ def tor_network(reactor, temp_dir, chutney, request): # ./chutney configure networks/basic # ./chutney start networks/basic + env = environ.copy() + env.update({"PYTHONPATH": join(chutney_dir, "lib")}) proto = _DumpOutputProtocol(None) reactor.spawnProcess( proto, @@ -492,7 +495,7 @@ def tor_network(reactor, temp_dir, chutney, request): join(chutney_dir, 'networks', 'basic'), ), path=join(chutney_dir), - env={"PYTHONPATH": join(chutney_dir, "lib")}, + env=env, ) pytest_twisted.blockon(proto.done) @@ -505,7 +508,7 @@ def tor_network(reactor, temp_dir, chutney, request): join(chutney_dir, 'networks', 'basic'), ), path=join(chutney_dir), - env={"PYTHONPATH": join(chutney_dir, "lib")}, + env=env, ) pytest_twisted.blockon(proto.done) @@ -519,7 +522,7 @@ def tor_network(reactor, temp_dir, chutney, request): join(chutney_dir, 'networks', 'basic'), ), path=join(chutney_dir), - env={"PYTHONPATH": join(chutney_dir, "lib")}, + env=env, ) try: pytest_twisted.blockon(proto.done) @@ -538,7 +541,7 @@ def tor_network(reactor, temp_dir, chutney, request): join(chutney_dir, 'networks', 'basic'), ), path=join(chutney_dir), - env={"PYTHONPATH": join(chutney_dir, "lib")}, + env=env, ) pytest_twisted.blockon(proto.done) request.addfinalizer(cleanup) From cd0ec043a8bd2643dc35aa889f514cd5214683ef Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 2 Aug 2019 16:50:21 -0600 Subject: [PATCH 2/3] Rely on the PATH now being passed down to find git --- integration/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration/conftest.py b/integration/conftest.py index 06ab51655..24173a9ea 100644 --- a/integration/conftest.py +++ b/integration/conftest.py @@ -462,9 +462,9 @@ def chutney(reactor, temp_dir): proto = _DumpOutputProtocol(None) reactor.spawnProcess( proto, - '/usr/bin/git', + 'git', ( - '/usr/bin/git', 'clone', '--depth=1', + 'git', 'clone', '--depth=1', 'https://git.torproject.org/chutney.git', chutney_dir, ), From e03ca27fdd147d1045dc9f91750a24d544a7052e Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 2 Aug 2019 16:50:45 -0600 Subject: [PATCH 3/3] news fragment --- newsfragments/3233.minor | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 newsfragments/3233.minor diff --git a/newsfragments/3233.minor b/newsfragments/3233.minor new file mode 100644 index 000000000..e69de29bb