summaryrefslogtreecommitdiffstats
path: root/chrome/test/chromeos
diff options
context:
space:
mode:
authordennisjeffrey@chromium.org <dennisjeffrey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-26 23:24:50 +0000
committerdennisjeffrey@chromium.org <dennisjeffrey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-26 23:24:50 +0000
commit59f6d593dc08be410d71c90040df9ed9e89af79b (patch)
tree7f4be7783cbd6a8ee1bccbe735d1cefb1aa53004 /chrome/test/chromeos
parentd6e2849d9f4335859b18342eea3bbbeb2a398512 (diff)
downloadchromium_src-59f6d593dc08be410d71c90040df9ed9e89af79b.zip
chromium_src-59f6d593dc08be410d71c90040df9ed9e89af79b.tar.gz
chromium_src-59f6d593dc08be410d71c90040df9ed9e89af79b.tar.bz2
Pyauto performance tests now output data to be graphed using autotest.
BUG=chromium-os:18185 TEST=None Review URL: http://codereview.chromium.org/7745007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98517 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/chromeos')
-rw-r--r--chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PyAutoPerfTests/desktopui_PyAutoPerfTests.py22
1 files changed, 21 insertions, 1 deletions
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 ce2e29e..7d908f1 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)