diff --git a/tests/conftest.py b/tests/conftest.py index b13dc500a62..afcfb7b170e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -147,6 +147,7 @@ def create( test, test_perf_signature, repository, + application='', ): return perf_models.PerformanceSignature.objects.create( repository=repository, @@ -160,6 +161,7 @@ def create( extra_options=extra_options, last_updated=datetime.datetime.now(), measurement_unit=measurement_unit, + application=application, ) return create diff --git a/tests/webapp/api/test_perfcompare_api.py b/tests/webapp/api/test_perfcompare_api.py index f30f949aa30..0e74bd6d384 100644 --- a/tests/webapp/api/test_perfcompare_api.py +++ b/tests/webapp/api/test_perfcompare_api.py @@ -39,6 +39,8 @@ def test_perfcompare_results_against_no_base( test = 'dhtml.html' extra_options = 'e10s fission stylo webrender' measurement_unit = 'ms' + base_application = 'firefox' + new_application = 'geckoview' base_sig = create_signature( signature_hash=(20 * 't1'), @@ -49,6 +51,7 @@ def test_perfcompare_results_against_no_base( test=test, test_perf_signature=test_perf_signature, repository=try_repository, + application=base_application, ) base_perf_data_values = [32.4] @@ -77,6 +80,7 @@ def test_perfcompare_results_against_no_base( test=test, test_perf_signature=test_perf_signature, repository=test_repository, + application=new_application, ) job = perf_jobs[1] @@ -108,6 +112,8 @@ def test_perfcompare_results_against_no_base( 'header_name': response['header_name'], 'base_repository_name': base_sig.repository.name, 'new_repository_name': new_sig.repository.name, + 'base_app': 'firefox', + 'new_app': 'geckoview', 'is_complete': response['is_complete'], 'base_measurement_unit': base_sig.measurement_unit, 'new_measurement_unit': new_sig.measurement_unit, @@ -188,6 +194,8 @@ def test_perfcompare_results_with_only_one_run_and_diff_repo( test = 'dhtml.html' extra_options = 'e10s fission stylo webrender' measurement_unit = 'ms' + base_application = 'firefox' + new_application = 'geckoview' base_sig = create_signature( signature_hash=(20 * 't1'), @@ -198,6 +206,7 @@ def test_perfcompare_results_with_only_one_run_and_diff_repo( test=test, test_perf_signature=test_perf_signature, repository=try_repository, + application=base_application, ) base_perf_data_values = [32.4] @@ -226,6 +235,7 @@ def test_perfcompare_results_with_only_one_run_and_diff_repo( test=test, test_perf_signature=test_perf_signature, repository=test_repository, + application=new_application, ) job = perf_jobs[1] @@ -257,6 +267,8 @@ def test_perfcompare_results_with_only_one_run_and_diff_repo( 'header_name': response['header_name'], 'base_repository_name': base_sig.repository.name, 'new_repository_name': new_sig.repository.name, + 'base_app': 'firefox', + 'new_app': 'geckoview', 'is_complete': response['is_complete'], 'base_measurement_unit': base_sig.measurement_unit, 'new_measurement_unit': new_sig.measurement_unit, @@ -413,6 +425,8 @@ def test_perfcompare_results_multiple_runs( 'header_name': first_row['header_name'], 'base_repository_name': sig1.repository.name, 'new_repository_name': sig2.repository.name, + 'base_app': '', + 'new_app': '', 'is_complete': first_row['is_complete'], 'base_measurement_unit': sig1.measurement_unit, 'new_measurement_unit': sig2.measurement_unit, @@ -457,6 +471,8 @@ def test_perfcompare_results_multiple_runs( 'header_name': second_row['header_name'], 'base_repository_name': sig3.repository.name, 'new_repository_name': sig4.repository.name, + 'base_app': '', + 'new_app': '', 'is_complete': second_row['is_complete'], 'base_measurement_unit': sig3.measurement_unit, 'new_measurement_unit': sig4.measurement_unit, diff --git a/treeherder/webapp/api/performance_data.py b/treeherder/webapp/api/performance_data.py index 2cb00a609df..8c165a2b0a6 100644 --- a/treeherder/webapp/api/performance_data.py +++ b/treeherder/webapp/api/performance_data.py @@ -931,6 +931,8 @@ def list(self, request): 'new_rev': new_rev, 'header_name': header, 'platform': platform, + 'base_app': base_sig.get('application', ''), + 'new_app': new_sig.get('application', ''), 'suite': base_sig.get('suite', ''), # same suite for base_result and new_result 'test': base_sig.get('test', ''), # same test for base_result and new_result 'is_complete': is_complete, @@ -1116,6 +1118,7 @@ def _get_signatures_values(signatures: List[PerformanceSignature]): 'measurement_unit', 'lower_is_better', 'signature_hash', + 'application', ) @staticmethod diff --git a/treeherder/webapp/api/performance_serializers.py b/treeherder/webapp/api/performance_serializers.py index c48a056cf6d..93da0a70c4a 100644 --- a/treeherder/webapp/api/performance_serializers.py +++ b/treeherder/webapp/api/performance_serializers.py @@ -443,6 +443,14 @@ def validate(self, data): class PerfCompareResultsSerializer(serializers.ModelSerializer): base_rev = serializers.CharField() new_rev = serializers.CharField() + base_app = serializers.CharField( + max_length=10, + default='', + ) + new_app = serializers.CharField( + max_length=10, + default='', + ) is_empty = serializers.BooleanField() is_complete = serializers.BooleanField() platform = serializers.CharField() @@ -489,6 +497,8 @@ class Meta: fields = [ 'base_rev', 'new_rev', + 'base_app', + 'new_app', 'framework_id', 'platform', 'suite',