From c9476f1837246cfe59c7a8e262e404def7c6f533 Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Fri, 28 Dec 2012 19:07:35 +0000 Subject: Make run-tests log everything --- (limited to 'devbot') diff --git a/devbot/run.py b/devbot/run.py index 23ef801..65eee8c 100644 --- a/devbot/run.py +++ b/devbot/run.py @@ -2,7 +2,6 @@ import os import string import random import subprocess -import sys import time import tempfile @@ -25,14 +24,19 @@ def run(cmd): def run_test(test_cmd, test_path): - temp_dir = tempfile.mkdtemp("sugar-build-test") + temp_dir = tempfile.mkdtemp("devbot-test-display") display_path = os.path.join(temp_dir, "display") args = [test_cmd, "--display-path", display_path, "--virtual"] - test_cmd_process = subprocess.Popen(args, stdout=subprocess.PIPE) + output_fd, output_name = tempfile.mkstemp("devbot-test-output") + output_file = os.fdopen(output_fd) + + test_cmd_process = subprocess.Popen(args, + stdout=output_file, + stderr=subprocess.STDOUT) while True: if not os.path.exists(display_path): @@ -54,6 +58,13 @@ def run_test(test_cmd, test_path): test_cmd_process.terminate() + output_file.seek(0) + with open(config.log_path, "a") as f: + f.write(output_file.read()) + + output_file.close() + os.unlink(output_name) + return result diff --git a/devbot/test.py b/devbot/test.py index 2acd721..44ddfa6 100644 --- a/devbot/test.py +++ b/devbot/test.py @@ -31,6 +31,8 @@ def _test_module(module): result = True if module.has_tests: + print "* Checking %s" % module.name + os.chdir(module.get_build_dir()) xvfb_proc, orig_display = xvfb.start() -- cgit v0.9.1