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

Unified Diff: scripts/slave/recipe_modules/chromium_tests/steps.py

Issue 2439213002: Add step to process Render Test results. (Closed)
Patch Set: Addressed jbudorick's nits Created 4 years, 1 month 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
Index: scripts/slave/recipe_modules/chromium_tests/steps.py
diff --git a/scripts/slave/recipe_modules/chromium_tests/steps.py b/scripts/slave/recipe_modules/chromium_tests/steps.py
index e5a404409498e8e5ef3a5121b783e3411c707cc5..c0f3c4a76a26a8b91de61c94ef8b073e6bc57b60 100644
--- a/scripts/slave/recipe_modules/chromium_tests/steps.py
+++ b/scripts/slave/recipe_modules/chromium_tests/steps.py
@@ -518,6 +518,7 @@ def generate_instrumentation_test(api, chromium_tests_api, mastername,
yield AndroidInstrumentationTest(
test_name,
compile_targets=test.get('override_compile_targets'),
+ render_results_dir=test.get('render_results_dir'),
timeout_scale=test.get('timeout_scale'),
result_details=True,
store_tombstones=True)
@@ -1501,27 +1502,33 @@ class AndroidTest(Test):
def run(self, api, suffix, test_filter=None):
assert api.chromium.c.TARGET_PLATFORM == 'android'
- json_results_file = api.test_utils.gtest_results(add_json_log=False)
- try:
- self.run_tests(api, suffix, json_results_file)
- finally:
- step_result = api.step.active_result
- self._test_runs[suffix] = {'valid': False}
- if (hasattr(step_result, 'test_utils') and
- hasattr(step_result.test_utils, 'gtest_results')):
- gtest_results = step_result.test_utils.gtest_results
- failures = gtest_results.failures
- self._test_runs[suffix] = {'valid': True, 'failures': failures}
- step_result.presentation.step_text += (
- api.test_utils.format_step_text([['failures:', failures]]))
+ nested_step_name = '%s%s' % (self._name, ' (%s)' % suffix if suffix else '')
+ with api.step.nest(nested_step_name) as nested_step:
ghost stip (do not use) 2016/12/08 20:16:02 cool, we may want to use this in other spots
+ json_results_file = api.test_utils.gtest_results(add_json_log=False)
+ try:
+ step_result = self.run_tests(api, suffix, json_results_file)
+ except api.step.StepFailure as f:
+ step_result = f.result
+ raise
+ finally:
+ nested_step.presentation.status = step_result.presentation.status
+ self._test_runs[suffix] = {'valid': False}
+ if (hasattr(step_result, 'test_utils') and
+ hasattr(step_result.test_utils, 'gtest_results')):
+ gtest_results = step_result.test_utils.gtest_results
+
+ failures = gtest_results.failures
+ self._test_runs[suffix] = {'valid': True, 'failures': failures}
+ nested_step.presentation.step_text += (
+ api.test_utils.format_step_text([['failures:', failures]]))
- api.test_results.upload(
- api.json.input(gtest_results.raw),
- test_type=self.name,
- chrome_revision=api.bot_update.last_returned_properties.get(
- 'got_revision_cp', 'x@{#0}'),
- test_results_server='test-results.appspot.com')
+ api.test_results.upload(
+ api.json.input(gtest_results.raw),
+ test_type=self.name,
+ chrome_revision=api.bot_update.last_returned_properties.get(
+ 'got_revision_cp', 'x@{#0}'),
+ test_results_server='test-results.appspot.com')
def compile_targets(self, _):
return self._compile_targets
@@ -1547,7 +1554,7 @@ class AndroidJunitTest(AndroidTest):
#override
def run_tests(self, api, suffix, json_results_file):
- api.chromium_android.run_java_unit_test_suite(
+ return api.chromium_android.run_java_unit_test_suite(
self.name, verbose=True, suffix=suffix,
json_results_file=json_results_file,
step_test_data=lambda: api.test_utils.test_api.canned_gtest_output(False))
@@ -1611,7 +1618,8 @@ class AndroidInstrumentationTest(AndroidTest):
test_apk=None, isolate_file_path=None, timeout_scale=None,
annotation=None, except_annotation=None, screenshot=False,
verbose=True, tool=None, additional_apks=None,
- store_tombstones=False, result_details=False):
+ store_tombstones=False, result_details=False,
+ render_results_dir=None):
suite_defaults = (
AndroidInstrumentationTest._DEFAULT_SUITES.get(name)
or AndroidInstrumentationTest._DEFAULT_SUITES_BY_TARGET.get(name)
@@ -1639,6 +1647,7 @@ class AndroidInstrumentationTest(AndroidTest):
self._wrapper_script_suite_name = compile_targets[0]
self._store_tombstones = store_tombstones
self._result_details = result_details
+ self._render_results_dir = render_results_dir
@property
def uses_local_devices(self):
@@ -1646,7 +1655,7 @@ class AndroidInstrumentationTest(AndroidTest):
#override
def run_tests(self, api, suffix, json_results_file):
- api.chromium_android.run_instrumentation_suite(
+ return api.chromium_android.run_instrumentation_suite(
self.name,
test_apk=api.chromium_android.apk_path(self._test_apk),
apk_under_test=api.chromium_android.apk_path(self._apk_under_test),
@@ -1662,6 +1671,7 @@ class AndroidInstrumentationTest(AndroidTest):
result_details=self._result_details,
store_tombstones=self._store_tombstones,
wrapper_script_suite_name=self._wrapper_script_suite_name,
+ render_results_dir=self._render_results_dir,
step_test_data=lambda: api.test_utils.test_api.canned_gtest_output(False))

Powered by Google App Engine
This is Rietveld 408576698