summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2017-05-24 13:27:51 +0100
committerJonathan Maw <jonathan.maw@codethink.co.uk>2017-05-25 12:05:15 +0100
commit04457a189484f08f1b8e5d495a3dbc9102d1f20c (patch)
treeefe36bc1c07d7887ece8d10685a90edf83a9912d
parent98a4492b13d312aaeb2a3ea3c115e33a1a0c447c (diff)
downloadbuildstream-04457a189484f08f1b8e5d495a3dbc9102d1f20c.tar.gz
Make logging go to stdout when the test suite is being run in CI
-rw-r--r--buildstream/plugin.py5
-rw-r--r--setup.cfg4
-rwxr-xr-xsetup.py1
3 files changed, 8 insertions, 2 deletions
diff --git a/buildstream/plugin.py b/buildstream/plugin.py
index f66e5c072..59753d247 100644
--- a/buildstream/plugin.py
+++ b/buildstream/plugin.py
@@ -22,6 +22,7 @@ import os
import datetime
import subprocess
import signal
+import sys
from subprocess import CalledProcessError
from contextlib import contextmanager
from weakref import WeakValueDictionary
@@ -548,7 +549,9 @@ class Plugin():
#
@contextmanager
def _output_file(self):
- if not self.__log:
+ if 'BST_TEST_SUITE' in os.environ:
+ yield sys.stdout
+ elif not self.__log:
with open(os.devnull, "w") as output:
yield output
else:
diff --git a/setup.cfg b/setup.cfg
index a89a2e902..96213b641 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -11,4 +11,6 @@ pep8ignore =
doc/source/conf.py ALL
tmp/* ALL
*/lib/python3* ALL
- */bin/* ALL \ No newline at end of file
+ */bin/* ALL
+env =
+ D:BST_TEST_SUITE=True
diff --git a/setup.py b/setup.py
index 42c4f4855..a36566f9a 100755
--- a/setup.py
+++ b/setup.py
@@ -119,5 +119,6 @@ setup(name='BuildStream',
'pytest-datafiles',
'pytest-pep8',
'pytest-cov',
+ 'pytest-env',
'pytest'],
zip_safe=False)