From 6b0a7c3ff6128381f0f61e44ba0e7f36b2e53038 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Wed, 22 Apr 2020 17:35:01 +0200 Subject: [PATCH] To get the groups which run in a task, use the concatenation of `result.group`s instead of a separate query to get run.suite.groups --- mozci/push.py | 12 ++---------- .../queries/push_tasks_groups_from_unittest.query | 14 -------------- mozci/task.py | 1 - 3 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 mozci/queries/push_tasks_groups_from_unittest.query diff --git a/mozci/push.py b/mozci/push.py index 2473cf6..5695dbc 100644 --- a/mozci/push.py +++ b/mozci/push.py @@ -297,17 +297,11 @@ class Push: # Gather information from the unittest table. We allow missing data for this table because # ActiveData only holds very recent data in it, but we have fallbacks on Taskcluster # artifacts. - # TODO: We have fallbacks for groups and results, but not for kind. try: add(run_query("push_tasks_results_from_unittest", args)) except MissingDataError: pass - try: - add(run_query("push_tasks_groups_from_unittest", args)) - except MissingDataError: - pass - # If we are missing one of these keys, discard the task. required_keys = ( "id", @@ -334,16 +328,14 @@ class Push: if isinstance(task["classification_note"], list): task["classification_note"] = task["classification_note"][-1] - if task.get("_groups"): - if isinstance(task["_groups"], str): - task["_groups"] = [task["_groups"]] - if task.get("_result_ok"): oks = task.pop("_result_ok") if task.get("_result_group"): groups = task.pop("_result_group") + task["_groups"] = groups + task["_results"] = [ GroupResult(group=group, ok=ok) for group, ok in zip(groups, oks) diff --git a/mozci/queries/push_tasks_groups_from_unittest.query b/mozci/queries/push_tasks_groups_from_unittest.query deleted file mode 100644 index 8a8da71..0000000 --- a/mozci/queries/push_tasks_groups_from_unittest.query +++ /dev/null @@ -1,14 +0,0 @@ -from: unittest -select: - - {name: id, value: task.id} - - {name: kind, value: task.kind} - - {name: _groups, value: run.suite.groups} -where: - and: - - eq: {etl.id: 0} - - prefix: {repo.changeset.id: {$eval: rev}} - - eq: {repo.branch.name: {$eval: branch}} - - ne: {treeherder.tier: 3} - - ne: {task.kind: "decision-task"} -limit: 10000 -format: table diff --git a/mozci/task.py b/mozci/task.py index 40434dc..c889fce 100644 --- a/mozci/task.py +++ b/mozci/task.py @@ -67,7 +67,6 @@ class Task: id: str label: str = field(default=None) - kind: str = field(default=None) duration: int = field(default=None) result: str = field(default=None) classification: str = field(default=None)