Skip to content

Commit 263382a

Browse files
committed
cleaning up
1 parent f6cc66e commit 263382a

1 file changed

Lines changed: 17 additions & 14 deletions

File tree

src/snovault/tests/elasticsearch_fixture.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
import subprocess
88

99

10+
# These are set in .circleci/config
11+
CIRCLE_BUILD = os.environ.get('BASH_ENV') == '/home/circleci/.bashrc'
12+
CICLE_ES_VERSION = os.environ.get('ES_MAJOR_VERSION')
13+
14+
15+
def _get_args_and_env():
16+
pass
17+
18+
1019
def server_process(
1120
datadir,
1221
configdir=None,
@@ -16,8 +25,8 @@ def server_process(
1625
prefix='',
1726
version=5,
1827
):
28+
env = os.environ.copy()
1929
if configdir:
20-
env = os.environ.copy()
2130
# How elasticsearch 6+ sets config path
2231
env["ES_PATH_CONF"] = configdir
2332
args = [
@@ -26,13 +35,6 @@ def server_process(
2635
if version <= 5:
2736
# How elasticsearch 5 sets config path
2837
args.append(f"-Epath.conf={configdir}")
29-
process = subprocess.Popen(
30-
args,
31-
close_fds=True,
32-
stdout=subprocess.PIPE,
33-
stderr=subprocess.STDOUT,
34-
env=env,
35-
)
3638
else:
3739
args = [
3840
os.path.join(prefix, 'elasticsearch'),
@@ -42,12 +44,13 @@ def server_process(
4244
'-Epath.logs=%s' % os.path.join(datadir, 'logs'),
4345
'-Epath.conf=./conf',
4446
]
45-
process = subprocess.Popen(
46-
args,
47-
close_fds=True,
48-
stdout=subprocess.PIPE,
49-
stderr=subprocess.STDOUT,
50-
)
47+
process = subprocess.Popen(
48+
args,
49+
close_fds=True,
50+
stdout=subprocess.PIPE,
51+
stderr=subprocess.STDOUT,
52+
env=env,
53+
)
5154

5255
SUCCESS_LINE = b'started\n'
5356
lines = []

0 commit comments

Comments
 (0)