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

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: Now computing sample standard deviation. 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') | no next file with comments »
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..7d908f1793251721518bf93ea0cf02d3f80fab09 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,19 @@ 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 when running '
+ 'with the CHROMEOS_PERF suite: %d' % proc.returncode)
+ 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.match(line)]
+ if perf_lines:
+ perf_dict = dict([eval(re_compiled.match(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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698