From e60122f2e4a31ab4f4b39e0a2b6358afaca43f4f Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Thu, 27 Dec 2012 18:44:21 +0000 Subject: Fix run and test logs --- 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"): -- cgit v0.9.1