Skip to content

Commit 71a8a23

Browse files
Retrieve PerfCompare results by comparing against the same application (#8521)
1 parent d7bb1b4 commit 71a8a23

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

Diff for: tests/webapp/api/test_perfcompare_api.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_perfcompare_results_against_no_base(
3939
extra_options = "e10s fission stylo webrender"
4040
measurement_unit = "ms"
4141
base_application = "firefox"
42-
new_application = "geckoview"
42+
new_application = "firefox"
4343

4444
base_sig = create_signature(
4545
signature_hash=(20 * "t1"),
@@ -115,8 +115,8 @@ def test_perfcompare_results_against_no_base(
115115
"header_name": response["header_name"],
116116
"base_repository_name": base_sig.repository.name,
117117
"new_repository_name": new_sig.repository.name,
118-
"base_app": "firefox",
119-
"new_app": "geckoview",
118+
"base_app": base_sig.application,
119+
"new_app": new_sig.application,
120120
"is_complete": response["is_complete"],
121121
"base_measurement_unit": base_sig.measurement_unit,
122122
"new_measurement_unit": new_sig.measurement_unit,
@@ -208,7 +208,7 @@ def test_perfcompare_results_with_only_one_run_and_diff_repo(
208208
extra_options = "e10s fission stylo webrender"
209209
measurement_unit = "ms"
210210
base_application = "firefox"
211-
new_application = "geckoview"
211+
new_application = "firefox"
212212

213213
base_sig = create_signature(
214214
signature_hash=(20 * "t1"),
@@ -284,8 +284,8 @@ def test_perfcompare_results_with_only_one_run_and_diff_repo(
284284
"header_name": response["header_name"],
285285
"base_repository_name": base_sig.repository.name,
286286
"new_repository_name": new_sig.repository.name,
287-
"base_app": "firefox",
288-
"new_app": "geckoview",
287+
"base_app": base_sig.application,
288+
"new_app": new_sig.application,
289289
"is_complete": response["is_complete"],
290290
"base_measurement_unit": base_sig.measurement_unit,
291291
"new_measurement_unit": new_sig.measurement_unit,
@@ -516,7 +516,7 @@ def test_perfcompare_results_subtests_support(
516516
extra_options = "e10s fission stylo webrender"
517517
measurement_unit = "ms"
518518
base_application = "firefox"
519-
new_application = "geckoview"
519+
new_application = "firefox"
520520

521521
base_sig = create_signature(
522522
signature_hash=(20 * "t1"),
@@ -596,8 +596,8 @@ def test_perfcompare_results_subtests_support(
596596
"header_name": response["header_name"],
597597
"base_repository_name": base_sig.repository.name,
598598
"new_repository_name": new_sig.repository.name,
599-
"base_app": "firefox",
600-
"new_app": "geckoview",
599+
"base_app": base_sig.application,
600+
"new_app": new_sig.application,
601601
"is_complete": response["is_complete"],
602602
"base_measurement_unit": base_sig.measurement_unit,
603603
"new_measurement_unit": new_sig.measurement_unit,
@@ -940,7 +940,7 @@ def get_expected(
940940
response = {"option_name": test_option_collection.get(sig.option_collection_id, "")}
941941
test_suite = perfcompare_utils.get_test_suite(sig.suite, sig.test)
942942
response["header_name"] = perfcompare_utils.get_header_name(
943-
extra_options, response["option_name"], test_suite
943+
extra_options, response["option_name"], test_suite, sig.application
944944
)
945945
response["base_avg_value"] = perfcompare_utils.get_avg(
946946
base_perf_data_values, response["header_name"]

Diff for: treeherder/webapp/api/perfcompare_utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def get_test_suite(suite, test):
3232
return suite if test == "" or test == suite else f"{suite} {test}"
3333

3434

35-
def get_header_name(extra_options, option_name, test_suite):
36-
name = f"{test_suite} {option_name} {extra_options}"
35+
def get_header_name(extra_options, option_name, test_suite, application):
36+
name = f"{test_suite} {option_name} {extra_options} {application}"
3737
return name
3838

3939

Diff for: treeherder/webapp/api/performance_data.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ def list(self, request):
892892
base_push = models.Push.objects.get(
893893
revision=base_rev, repository__name=base_repo_name
894894
)
895-
# Dynamically calculate an time interval based on the base and new push
895+
# Dynamically calculate a time interval based on the base and new push
896896
interval = self._get_interval(base_push, new_push)
897897
else:
898898
# Comparing without a base needs a timerange from which to gather the data needed
@@ -1261,10 +1261,13 @@ def _get_signatures_map(signatures, grouped_values, option_collection_map):
12611261
suite = signature["suite"]
12621262
test = signature["test"]
12631263
extra_options = signature["extra_options"]
1264+
application = signature["application"]
12641265
option_name = option_collection_map[signature["option_collection_id"]]
12651266
test_suite = perfcompare_utils.get_test_suite(suite, test)
12661267
platform = signature["platform__platform"]
1267-
header = perfcompare_utils.get_header_name(extra_options, option_name, test_suite)
1268+
header = perfcompare_utils.get_header_name(
1269+
extra_options, option_name, test_suite, application
1270+
)
12681271
sig_identifier = perfcompare_utils.get_sig_identifier(header, platform)
12691272

12701273
if sig_identifier not in signatures_map or (

0 commit comments

Comments
 (0)