You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bb...@apache.org on 2018/11/12 12:39:50 UTC
[mesos] 01/02: Explicitly constructed command line args in parallel
runner.
This is an automated email from the ASF dual-hosted git repository.
bbannier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
commit ca470667c5522b8cf41ad65cb12adadca771eb47
Author: Benjamin Bannier <bb...@apache.org>
AuthorDate: Sun Nov 11 00:25:36 2018 +0100
Explicitly constructed command line args in parallel runner.
This fixes issues with flag propagation into shards.
Review: https://reviews.apache.org/r/69309
---
support/mesos-gtest-runner.py | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/support/mesos-gtest-runner.py b/support/mesos-gtest-runner.py
index 043f136..255ac13 100755
--- a/support/mesos-gtest-runner.py
+++ b/support/mesos-gtest-runner.py
@@ -30,11 +30,11 @@ wrapper around that functionality and stream-lined output.
import argparse
import multiprocessing
import os
+import resource
import shlex
import signal
import subprocess
import sys
-import resource
class Bcolors:
@@ -69,9 +69,9 @@ def run_test(opts):
Perform an actual run of the test executable.
Expects a list of parameters giving the number of the current
- shard, the total number of shards, and the executable to run.
+ shard, the total number of shards, and the command line to run.
"""
- shard, nshards, executable = opts
+ shard, nshards, args = opts
signal.signal(signal.SIGINT, signal.SIG_IGN)
@@ -81,7 +81,7 @@ def run_test(opts):
try:
output = subprocess.check_output(
- executable.split(),
+ args,
stderr=subprocess.STDOUT,
env=env,
universal_newlines=True)
@@ -242,17 +242,18 @@ if __name__ == '__main__':
"""
opts = list(range(jobs))
+ args = [os.path.abspath(executable)]
+
# If we run in a terminal, enable colored test output. We
# still allow users to disable this themselves via extra args.
if sys.stdout.isatty():
- executable = '{exe} --gtest_color=yes'.format(exe=executable)
+ args.append('--gtest_color=yes')
if filter_:
- executable = '{exe} --gtest_filter={filter}'\
- .format(exe=executable, filter=filter_)
+ args.append('--gtest_filter={filter}'.format(filter=filter_))
for opt in opts:
- yield opt, jobs, executable
+ yield opt, jobs, args
try:
RESULTS = []