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

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

Issue 2330133002: Updating the SwarmingIsolatedScriptTest to upload chartjson results to the (Closed)
Patch Set: Updating steps.py to utilize new swarming api Created 4 years, 3 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 | scripts/slave/runtest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a67bb356e0e7cb6c155c5e58dc5cf2366a1cf3a1..4afe884d46307b020279aaee1f87b08a45067646 100644
--- a/scripts/slave/recipe_modules/chromium_tests/steps.py
+++ b/scripts/slave/recipe_modules/chromium_tests/steps.py
@@ -6,6 +6,8 @@ import datetime
import re
import string
+from slave import slave_utils
+from slave import results_dashboard
class Test(object):
"""
@@ -1082,6 +1084,8 @@ class SwarmingIsolatedScriptTest(SwarmingTest):
if not failures and step_result.retcode != 0:
failures = ['%s (entire test suite)' % self.name]
valid = False
+ # Check for chartjson results and upload to results dashboard if present.
+ self._output_charjson_results_if_present(api, step_result)
Ken Russell (switch to Gerrit) 2016/09/13 19:41:00 charjson -> chartjson
eyaich1 2016/09/14 18:42:29 Done.
except (ValueError, KeyError) as e:
step_result.presentation.logs['invalid_results_exc'] = [str(e)]
valid = False
@@ -1092,6 +1096,38 @@ class SwarmingIsolatedScriptTest(SwarmingTest):
])
return valid, failures
+ def _output_charjson_results_if_present(self, api, step_result):
Ken Russell (switch to Gerrit) 2016/09/13 19:40:59 Is this code path tested? Have you sent a CQ dry r
eyaich1 2016/09/14 18:42:29 Ah, so this is where they are called! Ok making s
+ results = getattr(step_result, 'isolated_script_chart_results', None) or {}
Ken Russell (switch to Gerrit) 2016/09/13 19:41:00 Also, for clarity, how about chart -> chartjson?
eyaich1 2016/09/14 18:42:29 Done.
+ try:
+ if not 'charts' in results:
+ print 'Info: No chart json present'
+ return
+
+ main_revision = \
+ GetMainRevision(api.properties, api.chromium.c.build_dir)
+ blink_revision = GetBlinkRevision(api.chromium.c.build_dir)
+ revisions = slave_utils.GetTelemetryRevisions(
+ api.properties, main_revision, blink_revision)
+ reference_build = 'reference' in self.name
+ stripped_test_name = self.name.replace('.reference', '')
+ dashboard_json = results_dashboard.MakeDashboardJsonV1(
+ results,
+ revisions, stripped_test_name, api.properties['perf-id'],
+ api.properties['buildername'], api.properties['buildnumber'],
+ None, reference_build)
+ if dashboard_json :
+ logging.debug(json.dumps(dashboard_json , indent=2))
+ results_dashboard.SendResults(
+ dashboard_json ,
+ api.properties['results-url'],
+ api.chromium.c.build_dir)
+ else:
+ print 'Error: No json output from telemetry.'
+ print '@@@STEP_FAILURE@@@'
+
+ except (ValueError, KeyError) as e:
+ print 'Error: Unable to upload chartjson results to perf dashboard'
+
def generate_isolated_script(api, chromium_tests_api, mastername, buildername,
test_spec, bot_update_step, enable_swarming=False,
« no previous file with comments | « no previous file | scripts/slave/runtest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698