diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-27 18:44:21 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-27 18:44:21 (GMT) |
commit | e60122f2e4a31ab4f4b39e0a2b6358afaca43f4f (patch) | |
tree | 1db5239da4d8fd9e536a4c01c7119b5e0ae5ef5c | |
parent | 51a2618bef58a15d2e56bb06a9b90afe48db0815 (diff) |
Fix run and test logs
-rwxr-xr-x | commands/run | 2 | ||||
-rwxr-xr-x | commands/run-tests | 4 | ||||
-rw-r--r-- | devbot/run.py | 9 |
3 files changed, 11 insertions, 4 deletions
diff --git a/commands/run b/commands/run index e08a1c2..5c4113b 100755 --- a/commands/run +++ b/commands/run @@ -8,7 +8,7 @@ import common from devbot import run from devbot import build -common.setup() +common.setup(log_name="run") if not build.build(): sys.exit(1) diff --git a/commands/run-tests b/commands/run-tests index ee0fbb5..a000f3b 100755 --- a/commands/run-tests +++ b/commands/run-tests @@ -10,7 +10,7 @@ import common from devbot import run from devbot import test -common.setup() +common.setup(log_name="test") def _run_ui_tests(): @@ -23,7 +23,7 @@ def _run_ui_tests(): result = run.run_test("sugar-runner", test_path, virtual) logs_path = os.path.join(profile_path, "logs") - run.collect_logs(logs_path, "test") + run.collect_logs(logs_path) if not result: sys.exit(1) diff --git a/devbot/run.py b/devbot/run.py index 8d47adb..038775b 100644 --- a/devbot/run.py +++ b/devbot/run.py @@ -5,6 +5,7 @@ import string import random import shutil import subprocess +import sys import time import tempfile @@ -25,6 +26,12 @@ def run(command): if output: args.extend(["--output", output]) + stdout = open(config.log_path, 'a') + stderr = stdout + + os.dup2(stdout.fileno(), sys.stdout.fileno()) + os.dup2(stderr.fileno(), sys.stderr.fileno()) + os.execlp(args[0], *args) @@ -63,7 +70,7 @@ def run_test(command, test_path, virtual=False): return result -def collect_logs(source_path, log_name): +def collect_logs(source_path): logs = {} for filename in os.listdir(source_path): if filename.endswith(".log"): |