diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 529: fill out log_lineno for lava-test-shell results so that the dashboard can link to the line in the...

Message ID 20130114210113.26777.31327.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Michael-Doyle Hudson Jan. 14, 2013, 9:01 p.m. UTC
Merge authors:
  Michael Hudson-Doyle (mwhudson)
Related merge proposals:
  https://code.launchpad.net/~mwhudson/lava-dispatcher/lava-test-shell-log-lineno/+merge/143059
  proposed by: Michael Hudson-Doyle (mwhudson)
  review: Approve - Andy Doan (doanac)
------------------------------------------------------------
revno: 529 [merge]
committer: Michael Hudson-Doyle <michael.hudson@linaro.org>
branch nick: trunk
timestamp: Tue 2013-01-15 10:00:36 +1300
message:
  fill out log_lineno for lava-test-shell results so that the dashboard can link to the line in the log
modified:
  lava_dispatcher/actions/lava_test_shell.py
  lava_dispatcher/lava_test_shell.py


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_dispatcher/actions/lava_test_shell.py'
--- lava_dispatcher/actions/lava_test_shell.py	2013-01-14 16:29:38 +0000
+++ lava_dispatcher/actions/lava_test_shell.py	2013-01-14 20:59:03 +0000
@@ -125,6 +125,7 @@ 
 from lava_dispatcher import utils
 
 from lava_dispatcher.actions import BaseAction
+from lava_dispatcher.client.base import wait_for_prompt
 from lava_dispatcher.device.target import Target
 from lava_dispatcher.downloader import download_image
 
@@ -455,7 +456,8 @@ 
 
         with target.runner() as runner:
             runner.wait_for_prompt(timeout)
-            runner._connection.sendline("%s/bin/lava-test-runner" % target.deployment_data['lava_test_dir'])
+            runner._connection.sendline(
+                "%s/bin/lava-test-runner" % target.deployment_data['lava_test_dir'])
             start = time.time()
             if timeout == -1:
                 timeout = runner._connection.timeout

=== modified file 'lava_dispatcher/lava_test_shell.py'
--- lava_dispatcher/lava_test_shell.py	2012-12-20 03:35:44 +0000
+++ lava_dispatcher/lava_test_shell.py	2013-01-14 03:08:36 +0000
@@ -227,7 +227,7 @@ 
                      'UNKNOWN': 'unknown'}
         logging.warning("""Using a default pattern to parse the test result. This may lead to empty test result in certain cases.""")
 
-    for line in stdout.split('\n'):
+    for lineno, line in enumerate(stdout.split('\n'), 1):
         match = pattern.match(line.strip())
         if match:
             res = match.groupdict()
@@ -237,7 +237,8 @@ 
                 if res['result'] not in ('pass', 'fail', 'skip', 'unknown'):
                     logging.error('bad test result line: %s' % line.strip())
                     continue
-
+            res['log_lineno'] = lineno
+            res['log_filename'] = 'stdout.log'
             results_from_log_file.append(res)
 
     results_from_directories = []