Skip to content

Commit ed9e84e

Browse files
committed
WIP: Retrieve the groupsummary with the dates
1 parent 527b555 commit ed9e84e

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ def mock_get_summary_groups_request(monkeypatch):
970970
Mock get_summary_groups()
971971
"""
972972

973-
def _get_summary_groups():
973+
def _get_summary_groups(start_day, end_day):
974974
tests_folder = os.path.dirname(__file__)
975975
file_name = "summary_groups.json"
976976
data_path = os.path.join(tests_folder, "sample_data", file_name)

treeherder/intermittents_commenter/commenter.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def generate_bug_changes(self, startday, endday, alt_startday, alt_endday):
8080

8181
bug_ids, bugs = self.get_bugs(startday, endday)
8282
option_collection_map = OptionCollection.objects.get_option_collection_map()
83-
bug_map = self.build_bug_map(bugs, option_collection_map)
83+
bug_map = self.build_bug_map(bugs, option_collection_map, startday, endday)
8484

8585
alt_date_bug_totals = self.get_alt_date_bug_totals(alt_startday, alt_endday, bug_ids)
8686

@@ -387,10 +387,12 @@ def get_bug_run_info(self, bug):
387387
info.build_type = "unknown build"
388388
return info
389389

390-
def get_task_labels_and_count(self, manifest):
390+
def get_task_labels_and_count(self, manifest, start_day, end_day):
391391
tasks_and_count = {}
392392
summary_groups = (
393-
fetch.get_summary_groups() if self.summary_groups is None else self.summary_groups
393+
fetch.get_summary_groups(start_day, end_day)
394+
if self.summary_groups is None
395+
else self.summary_groups
394396
)
395397
all_task_labels = summary_groups["job_type_names"]
396398
for tasks_by_manifest in summary_groups["manifests"]:
@@ -402,7 +404,7 @@ def get_task_labels_and_count(self, manifest):
402404
tasks_and_count[task_label] += count
403405
return tasks_and_count
404406

405-
def build_bug_map(self, bugs, option_collection_map):
407+
def build_bug_map(self, bugs, option_collection_map, start_day, end_day):
406408
"""Build bug_map
407409
eg:
408410
{
@@ -434,7 +436,7 @@ def build_bug_map(self, bugs, option_collection_map):
434436
for bug in bugs:
435437
bug_id = bug["bug__bugzilla_id"]
436438
manifest = self.get_test_manifest(bug["bug__summary"])
437-
task_labels = self.get_task_labels_and_count(manifest)
439+
task_labels = self.get_task_labels_and_count(manifest, start_day, end_day)
438440
print(task_labels)
439441
bug_testrun_matrix = []
440442
if manifest:

treeherder/intermittents_commenter/fetch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def fetch_testrun_matrix():
2424
return response.json()
2525

2626

27-
def get_summary_groups():
27+
def get_summary_groups(start_day, end_day):
2828
url = "https://treeherder.mozilla.org/api/groupsummary/"
2929
response = requests.get(url, headers={"User-agent": "mach-test-info/1.0"})
3030
return response.json()

0 commit comments

Comments
 (0)