Chromium Code Reviews| Index: scripts/master/factory/chromium_commands.py |
| =================================================================== |
| --- scripts/master/factory/chromium_commands.py (revision 136971) |
| +++ scripts/master/factory/chromium_commands.py (working copy) |
| @@ -286,6 +286,24 @@ |
| # Add the test step to the factory. |
| self.AddTestStep(test_class, test, cmd, do_step_if=self.TestStepFilter) |
| + def AddWebPageReplayTest(self, test_name, wpr_test, |
|
tonyg_google
2012/05/31 01:59:56
A selfish suggestion: I'm going to be adding some
dennis_jeffrey
2012/05/31 17:18:53
I think we could just get rid of this function and
slamm_google
2012/06/02 22:04:56
Done.
|
| + factory_properties=None, timeout=1800): |
| + """Add Web Page Replay Page Cycler test step. |
| + |
| + Args: |
| + test_name: a string describing the test, used to build its logfile name |
| + and its descriptions in the waterfall display |
| + wpr_test_suffix: suffix of pyauto test: |
| + perf.WebPageReplayPageCyclerTest.{wpr_test} |
| + factory_properties: A dictionary of factory property values. |
| + timeout: The buildbot timeout for this step, in seconds. The step will |
| + fail if the test does not produce any output within this time. |
| + """ |
| + pyauto_test = 'perf.WebPageReplayPageCyclerTest.%s' % wpr_test |
| + self.AddPyAutoFunctionalTest( |
| + test_name, test_args=[pyauto_test], timeout=timeout, |
| + perf=True, factory_properties=factory_properties) |
| + |
| def AddStartupTests(self, factory_properties=None): |
| factory_properties = factory_properties or {} |
| c = self.GetPerfStepClass(factory_properties, 'startup', |
| @@ -665,58 +683,58 @@ |
| def AddPyAutoFunctionalTest(self, test_name, timeout=1200, |
|
slamm_google
2012/05/31 00:05:28
Most of this diff is making the code a little easi
|
| workdir=None, |
| - src_base=None, |
| + src_base='.', |
| suite=None, |
| + test_args=None, |
| factory_properties=None, |
| perf=False): |
| """Adds a step to run PyAuto functional tests. |
| Args: |
| + test_name: a string describing the test, used to build its logfile name |
| + and its descriptions in the waterfall display |
| + timeout: The buildbot timeout for this step, in seconds. The step will |
| + fail if the test does not produce any output within this time. |
| workdir: the working dir for this step |
| src_base: relative path (from workdir) to src. Not needed if workdir is |
| - 'build' (the default) |
| + 'build' (the default) |
| suite: PyAuto suite to execute. |
| - perf: Is this a perf test or not? Requires suite to be set. |
| + test_args: list of PyAuto test arguments. |
| + factory_properties: A dictionary of factory property values. |
| + perf: Is this a perf test or not? Requires suite or test_args to be set. |
| """ |
| factory_properties = factory_properties or {} |
| J = self.PathJoin |
| - pyauto_script = J('src', 'chrome', 'test', 'functional', |
| + pyauto_script = J(src_base, 'src', 'chrome', 'test', 'functional', |
|
dennis_jeffrey
2012/05/31 17:18:53
Cool! I really like how the "src_base" parameter
|
| 'pyauto_functional.py') |
| - # in case a '..' prefix is needed |
| - if src_base: |
| - pyauto_script = J(src_base, pyauto_script) |
| - |
| - pyauto_functional_cmd = ['python', pyauto_script, '-v'] |
| + pyauto_cmd = ['python', pyauto_script, '-v'] |
| if self._target_platform == 'win32': |
| - pyauto_functional_cmd = self.GetPythonTestCommand(pyauto_script, ['-v']) |
| - if src_base: # Adjust runtest.py path if needed. |
| - pyauto_functional_cmd[1] = J(src_base, pyauto_functional_cmd[1]) |
| + pyauto_cmd = self.GetPythonTestCommand(pyauto_script, ['-v']) |
| + pyauto_cmd[1] = J(src_base, pyauto_cmd[1]) # adjust runtest.py if needed |
| elif self._target_platform == 'darwin': |
| - pyauto_functional_cmd = self.GetTestCommand('/usr/bin/python2.5', |
| - [pyauto_script, '-v']) |
| - if src_base: # Adjust runtest.py path if needed. |
| - pyauto_functional_cmd[1] = J(src_base, pyauto_functional_cmd[1]) |
| + pyauto_cmd = self.GetTestCommand('/usr/bin/python2.5', |
| + [pyauto_script, '-v']) |
| + pyauto_cmd[1] = J(src_base, pyauto_cmd[1]) # adjust runtest.py if needed |
| elif (self._target_platform.startswith('linux') and |
| factory_properties.get('use_xvfb_on_linux')): |
| - # Run thru runtest.py on linux to launch virtual x server |
| - pyauto_functional_cmd = self.GetTestCommand('/usr/bin/python', |
| - [pyauto_script, '-v']) |
| - if src_base: # Adjust runtest.py path if needed. |
| - pyauto_functional_cmd[1] = J(src_base, pyauto_functional_cmd[1]) |
| - |
| + # On Linux, use runtest.py to launch virtual X server. |
| + pyauto_cmd = self.GetTestCommand('/usr/bin/python', [pyauto_script, '-v']) |
| + pyauto_cmd[1] = J(src_base, pyauto_cmd[1]) # adjust runtest.py if needed |
| if suite: |
|
dennis_jeffrey
2012/05/31 17:18:53
nit: I recommend adding a blank line right above t
slamm_google
2012/06/02 22:04:56
Done.
|
| - pyauto_functional_cmd.append('--suite=%s' % suite) |
| + pyauto_cmd.append('--suite=%s' % suite) |
| + if test_args: |
| + pyauto_cmd.extend(test_args) |
| - # Use special command class for parsing perf values from output. |
| command_class = retcode_command.ReturnCodeCommand |
| - if perf and suite: |
| + if perf and (suite or test_args): |
| + # Use special command class for parsing perf values from output. |
| command_class = self.GetPerfStepClass( |
| factory_properties, suite.lower(), |
| process_log.GraphingLogProcessor) |
| self.AddTestStep(command_class, |
| test_name, |
| - pyauto_functional_cmd, |
| + pyauto_cmd, |
| env={'PYTHONPATH': '.'}, |
| workdir=workdir, |
| timeout=timeout, |
| @@ -741,18 +759,17 @@ |
| return |
| for pyauto_test_name in pyauto_test_list: |
| - pyauto_functional_cmd = ['python', pyauto_script, '-v'] |
| + pyauto_cmd = ['python', pyauto_script, '-v'] |
| if factory_properties.get('use_xvfb_on_linux'): |
| # Run through runtest.py on linux to launch virtual x server. |
| - pyauto_functional_cmd = self.GetTestCommand('/usr/bin/python', |
| - [pyauto_script, '-v']) |
| - |
| - pyauto_functional_cmd.append(pyauto_test_name) |
| + pyauto_cmd = self.GetTestCommand('/usr/bin/python', |
| + [pyauto_script, '-v']) |
| + pyauto_cmd.append(pyauto_test_name) |
| test_step_name = (test_class_name + ' ' + |
| pyauto_test_name[pyauto_test_name.rfind('.') + 1:]) |
| self.AddTestStep(retcode_command.ReturnCodeCommand, |
| test_step_name, |
| - pyauto_functional_cmd, |
| + pyauto_cmd, |
| env={'PYTHONPATH': '.'}, |
| timeout=timeout, |
| do_step_if=self.GetTestStepFilter(factory_properties)) |