Commit b2c3c0c0 authored by frankf@chromium.org's avatar frankf@chromium.org

[Android] Create out directory for sharded perf tests during setup.

BUG=
R=bulach@chromium.org

Review URL: https://codereview.chromium.org/23601019

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221731 0039d316-1c4b-4281-b951-d872f2087c98
parent 2196ec32
......@@ -106,6 +106,7 @@ SDK_BUILD_JAVALIB_DIR = 'lib.java'
SDK_BUILD_TEST_JAVALIB_DIR = 'test.lib.java'
SDK_BUILD_APKS_DIR = 'apks'
PERF_OUTPUT_DIR = os.path.join(DIR_SOURCE_ROOT, 'out', 'step_results')
# The directory on the device where perf test output gets saved to.
DEVICE_PERF_OUTPUT_DIR = '/data/data/' + CHROME_PACKAGE + '/files'
......
......@@ -13,6 +13,7 @@ import time
from pylib import android_commands
from pylib import cmd_helper
from pylib import constants
from pylib import forwarder
from pylib import ports
......@@ -56,6 +57,9 @@ def Setup(test_options):
Returns:
A tuple of (TestRunnerFactory, tests).
"""
if not os.path.exists(constants.PERF_OUTPUT_DIR):
os.makedirs(constants.PERF_OUTPUT_DIR)
# Before running the tests, kill any leftover server.
_KillPendingServers()
......
......@@ -46,16 +46,12 @@ import pexpect
import pickle
import os
import sys
import time
from pylib import constants
from pylib.base import base_test_result
from pylib.base import base_test_runner
_OUTPUT_DIR = os.path.join(constants.DIR_SOURCE_ROOT, 'out', 'step_results')
def PrintTestOutput(test_name):
"""Helper method to print the output of previously executed test_name.
......@@ -65,7 +61,7 @@ def PrintTestOutput(test_name):
Returns:
exit code generated by the test step.
"""
file_name = os.path.join(_OUTPUT_DIR, test_name)
file_name = os.path.join(constants.PERF_OUTPUT_DIR, test_name)
if not os.path.exists(file_name):
logging.error('File not found %s', file_name)
return 1
......@@ -98,7 +94,8 @@ class TestRunner(base_test_runner.BaseTestRunner):
@staticmethod
def _SaveResult(result):
with file(os.path.join(_OUTPUT_DIR, result['name']), 'w') as f:
with file(os.path.join(constants.PERF_OUTPUT_DIR,
result['name']), 'w') as f:
f.write(pickle.dumps(result))
def _LaunchPerfTest(self, test_name):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment