Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/devbot/run.py
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-12-28 19:07:35 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-12-28 19:08:58 (GMT)
commitc9476f1837246cfe59c7a8e262e404def7c6f533 (patch)
treef1bb5669eade2419e20965ec61aa529f1c821635 /devbot/run.py
parent18bda03d4ba8722b9d78d4a83896b8cfbb2ba489 (diff)
Make run-tests log everything
Diffstat (limited to 'devbot/run.py')
-rw-r--r--devbot/run.py17
1 files changed, 14 insertions, 3 deletions
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