From e6a6c403db7e9ef9bd66092665ecbeddac61e3ee Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 2 Jul 2013 09:25:55 -0700 Subject: [PATCH] Add ability to skip log capture. Change-Id: I8f3ac5c469e9d530d1ac7776c7488d0c42cdf1ad Reviewed-on: https://review.openstack.org/35329 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins --- .testr.conf | 2 +- tests/test_scheduler.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.testr.conf b/.testr.conf index c4ecf2c5db..5433c070e3 100644 --- a/.testr.conf +++ b/.testr.conf @@ -1,4 +1,4 @@ [DEFAULT] -test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ tests $LISTOPT $IDOPTION +test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} OS_LOG_CAPTURE=${OS_LOG_CAPTURE:-1} ${PYTHON:-python} -m subunit.run discover -t ./ tests $LISTOPT $IDOPTION test_id_option=--load-list $IDFILE test_list_option=--list diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py index da9b4318a4..100b9245bd 100644 --- a/tests/test_scheduler.py +++ b/tests/test_scheduler.py @@ -680,7 +680,9 @@ class TestScheduler(testtools.TestCase): stderr = self.useFixture(fixtures.StringStream('stderr')).stream self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr)) self.useFixture(fixtures.NestedTempfile()) - self.log_fixture = self.useFixture(fixtures.FakeLogger()) + if (os.environ.get('OS_LOG_CAPTURE') == 'True' or + os.environ.get('OS_LOG_CAPTURE') == '1'): + self.useFixture(fixtures.FakeLogger()) tmp_root = os.environ.get("ZUUL_TEST_ROOT", tempfile.mkdtemp()) self.test_root = os.path.join(tmp_root, "zuul-test")