@@ -42,6 +42,7 @@ class BugRunInfo:
42
42
43
43
@dataclass
44
44
class BugsDetails :
45
+ run_count : dict [str , int ] = field (default_factory = dict ) # {job_name: run_count}
45
46
total : int = 0
46
47
test_variants : set = field (default_factory = set )
47
48
per_repositories : dict [str , int ] = field (default_factory = dict ) # {repo1: 1, repo2: 2, ...}
@@ -443,18 +444,27 @@ def build_bug_map(self, bugs, option_collection_map, start_day, end_day):
443
444
all_variants = set ()
444
445
for bug in bugs :
445
446
bug_id = bug ["bug__bugzilla_id" ]
446
- manifest = self .get_test_manifest ( bug [ "bug__summary" ] )
447
- task_labels = self .get_task_labels_and_count ( manifest , start_day , end_day )
448
- print ( task_labels )
447
+ all_tests = self .get_tests_from_manifests ( )
448
+ test_name = self .get_test_name ( all_tests , bug [ "bug__summary" ] )
449
+ manifest = None
449
450
bug_testrun_matrix = []
450
- if manifest :
451
- testrun_matrix = (
452
- fetch .fetch_testrun_matrix ()
453
- if self .testrun_matrix is None
454
- else self .testrun_matrix
455
- )
456
- self .testrun_matrix = testrun_matrix
457
- bug_testrun_matrix = testrun_matrix [manifest ]
451
+ run_count = 0
452
+ if test_name :
453
+ manifest = all_tests [test_name ][0 ]
454
+ if manifest :
455
+ tasks_count = self .get_task_labels_and_count (manifest , start_day , end_day )
456
+ job_name = bug ["job__signature__job_type_name" ]
457
+ for task_name , count in tasks_count .items ():
458
+ if task_name in job_name :
459
+ run_count = count
460
+ break
461
+ testrun_matrix = (
462
+ fetch .fetch_testrun_matrix ()
463
+ if self .testrun_matrix is None
464
+ else self .testrun_matrix
465
+ )
466
+ self .testrun_matrix = testrun_matrix
467
+ bug_testrun_matrix = testrun_matrix [manifest ]
458
468
bug_run_info = self .get_bug_run_info (bug )
459
469
all_variants = bug_run_info .variants
460
470
if bug_testrun_matrix and bug_run_info .os_name in bug_testrun_matrix :
@@ -473,7 +483,10 @@ def build_bug_map(self, bugs, option_collection_map, start_day, end_day):
473
483
bug_infos .total = 1
474
484
bug_infos .test_variants |= all_variants
475
485
bug_infos .per_repositories [repo ] = 1
476
- bug_infos .data_table [platform_and_build ] = {test_variant : 1 }
486
+ bug_infos .data_table [platform_and_build ] = {
487
+ test_variant : 1 ,
488
+ "total_runs" : run_count ,
489
+ }
477
490
bug_map [bug_id ] = bug_infos
478
491
else :
479
492
bug_infos = bug_map [bug_id ]
@@ -485,6 +498,7 @@ def build_bug_map(self, bugs, option_collection_map, start_day, end_day):
485
498
data_table = bug_infos .data_table
486
499
platform_and_build_data = data_table .get (platform_and_build , {})
487
500
data_table [platform_and_build ] = platform_and_build_data
501
+ data_table [platform_and_build ]["total_runs" ] = run_count
488
502
data_table [platform_and_build ][test_variant ] = (
489
503
platform_and_build_data .get (test_variant , 0 ) + 1
490
504
)
@@ -556,8 +570,7 @@ def fix_wpt_name(self, test_name):
556
570
test_name = test_name .split ("?" )[0 ]
557
571
return test_name
558
572
559
- def get_test_manifest (self , summary ):
560
- all_tests = self .get_tests_from_manifests ()
573
+ def get_test_name (self , all_tests , summary ):
561
574
tv_strings = [
562
575
" TV " ,
563
576
" TV-nofis " ,
@@ -620,7 +633,5 @@ def get_test_manifest(self, summary):
620
633
# 3) test has been deleted from the source tree
621
634
# 4) sometimes test was deleted but is valid on beta
622
635
return None
623
- # matching test- we can access manifest
624
- manifests = all_tests [test_name ]
625
- return manifests [0 ]
636
+ return test_name
626
637
return None
0 commit comments