Bug 1593942 - Provide browser name and version being tested in perfherder data. r=perftest-reviewers,stephendonner

This patch makes use of the new application section in the perfherder data to provide the browser name and version being tested.

Differential Revision: https://phabricator.services.mozilla.com/D52565

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Gregory Mierzwinski 2019-11-11 18:43:58 +00:00
Родитель 8b473b9f57
Коммит 0db1b2484f
3 изменённых файлов: 36 добавлений и 2 удалений

Просмотреть файл

@ -33,11 +33,18 @@ class PerftestOutput(object):
self.summarized_supporting_data = []
self.summarized_screenshots = []
self.subtest_alert_on = subtest_alert_on
self.browser_name = None
self.browser_version = None
@abstractmethod
def summarize(self, test_names):
raise NotImplementedError()
def set_browser_meta(self, browser_name, browser_version):
# sets the browser metadata for the perfherder data
self.browser_name = browser_name
self.browser_version = browser_version
def summarize_supporting_data(self):
'''
Supporting data was gathered outside of the main raptor test; it will be kept
@ -123,7 +130,14 @@ class PerftestOutput(object):
# split the supporting data by type, there will be one
# perfherder output per type
for data_type in support_data_by_type:
self.summarized_supporting_data.append(support_data_by_type[data_type])
data = support_data_by_type[data_type]
if self.browser_name:
data['application'] = {
'name': self.browser_name
}
if self.browser_version:
data['application']['version'] = self.browser_version
self.summarized_supporting_data.append(data)
return
@ -190,6 +204,13 @@ class PerftestOutput(object):
LOG.info("scenario test type was run %s" % not_posting)
output_perf_data = False
if self.browser_name:
self.summarized_results['application'] = {
'name': self.browser_name
}
if self.browser_version:
self.summarized_results['application']['version'] = self.browser_version
total_perfdata = 0
if output_perf_data:
# if we have supporting data i.e. power, we ONLY want those measurements

Просмотреть файл

@ -152,6 +152,9 @@ either Raptor or browsertime."""
self.browser_name, self.browser_version = self.get_browser_meta()
browser_name, browser_version = self.get_browser_meta()
self.results_handler.add_browser_meta(self.config['app'], browser_version)
# debug mode is currently only supported when running locally
self.debug_mode = debug_mode if self.config['run_local'] else False
@ -809,6 +812,8 @@ class Raptor(Perftest):
cpu_test=self.config.get('cpu_test'),
memory_test=self.config.get('memory_test'),
)
browser_name, browser_version = self.get_browser_meta()
self.results_handler.add_browser_meta(self.config['app'], browser_version)
self.start_control_server()

Просмотреть файл

@ -33,11 +33,18 @@ class PerftestResultsHandler(object):
self.page_timeout_list = []
self.images = []
self.supporting_data = None
self.browser_version = None
self.browser_name = None
@abstractmethod
def add(self, new_result_json):
raise NotImplementedError()
def add_browser_meta(self, browser_name, browser_version):
# sets the browser metadata for the perfherder data
self.browser_name = browser_name
self.browser_version = browser_version
def add_image(self, screenshot, test_name, page_cycle):
# add to results
LOG.info("received screenshot")
@ -172,6 +179,7 @@ class RaptorResultsHandler(PerftestResultsHandler):
# summarize the result data, write to file and output PERFHERDER_DATA
LOG.info("summarizing raptor test results")
output = RaptorOutput(self.results, self.supporting_data, test_config['subtest_alert_on'])
output.set_browser_meta(self.browser_name, self.browser_version)
output.summarize(test_names)
# that has each browser cycle separate; need to check if there were multiple browser
# cycles, and if so need to combine results from all cycles into one overall result
@ -563,7 +571,7 @@ class BrowsertimeResultsHandler(PerftestResultsHandler):
output = BrowsertimeOutput(self.results,
self.supporting_data,
test_config['subtest_alert_on'])
output.set_browser_meta(self.browser_name, self.browser_version)
output.summarize(test_names)
success, out_perfdata = output.output(test_names)