Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoPerfTests/desktopui_PyAutoPerfTests.py

Issue 7745007: Pyauto performance tests now output data to be graphed using autotest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed second round of review comments. Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/functional/perf.py » ('j') | chrome/test/functional/perf.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoPerfTests/desktopui_PyAutoPerfTests.py
diff --git a/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoPerfTests/desktopui_PyAutoPerfTests.py b/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoPerfTests/desktopui_PyAutoPerfTests.py
index ce2e29e005e891dfa8abbe428344b6bd9d447ea4..d2591c5b0a269074f8a90b7f61e6fba9ea8b757a 100644
--- a/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoPerfTests/desktopui_PyAutoPerfTests.py
+++ b/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoPerfTests/desktopui_PyAutoPerfTests.py
@@ -4,10 +4,12 @@
import os
import pwd
+import re
import shutil
import subprocess
from autotest_lib.client.bin import utils
+from autotest_lib.client.common_lib import error
from autotest_lib.client.cros import constants, chrome_test, cros_ui, login
@@ -16,6 +18,9 @@ class desktopui_PyAutoPerfTests(chrome_test.ChromeTestBase):
Performs all setup and fires off the CHROMEOS_PERF PyAuto suite.
"""
+ _PERF_MARKER_PRE = '_PERF_PRE_'
+ _PERF_MARKER_POST = '_PERF_POST_'
+
version = 1
def initialize(self):
@@ -74,4 +79,18 @@ class desktopui_PyAutoPerfTests(chrome_test.ChromeTestBase):
functional_cmd = cros_ui.xcommand_as(
'%s/chrome_test/test_src/chrome/test/functional/'
'pyauto_functional.py --suite=CHROMEOS_PERF -v' % deps_dir)
- utils.system(functional_cmd)
+ proc = subprocess.Popen(
+ functional_cmd, shell=True, stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT)
+ output = proc.communicate()[0]
+ if proc.returncode != 0:
+ raise error.TestFail('Unexpected return code from '
+ 'pyauto_functional.py: %d' % proc.returncode)
truty 2011/08/25 04:25:01 You should consider if you want to tag this TestFa
dennis_jeffrey 2011/08/25 22:33:05 Good idea - I added CHROMEOS_PERF to the failure m
+ re_compiled = re.compile('%s(.+)%s' % (self._PERF_MARKER_PRE,
+ self._PERF_MARKER_POST))
+ perf_lines = [line for line in output.split('\n')
+ if re_compiled.search(line)]
truty 2011/08/25 04:25:01 Based on the way you wrote the perf value line cre
dennis_jeffrey 2011/08/25 22:33:05 That thought did cross my mind, but I decided to b
+ if perf_lines:
+ perf_dict = dict([eval(re_compiled.search(line).group(1))
+ for line in perf_lines])
+ self.write_perf_keyval(perf_dict)
« no previous file with comments | « no previous file | chrome/test/functional/perf.py » ('j') | chrome/test/functional/perf.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698