From 27e903bab82b5b6ba6fc959fb888efb920a16a61 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Thu, 13 Dec 2018 11:38:48 +0100 Subject: [PATCH] Decision task: print IDs of tasks scheduled or found in the index --- etc/taskcluster/decisionlib.py | 6 ++++-- etc/taskcluster/mock.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/etc/taskcluster/decisionlib.py b/etc/taskcluster/decisionlib.py index e5d6cd24767..7a4892cd901 100644 --- a/etc/taskcluster/decisionlib.py +++ b/etc/taskcluster/decisionlib.py @@ -228,13 +228,15 @@ class Task: task_id = taskcluster.slugId().decode("utf8") SHARED.queue_service.createTask(task_id, queue_payload) - print("Scheduled %s" % self.name) + print("Scheduled %s: %s" % (task_id, self.name)) return task_id @staticmethod def find(index_path): full_index_path = "%s.%s" % (CONFIG.index_prefix, index_path) - return SHARED.index_service.findTask(full_index_path)["taskId"] + task_id = SHARED.index_service.findTask(full_index_path)["taskId"] + print("Found task %s indexed at %s" % (task_id, full_index_path)) + return task_id def find_or_create(self, index_path=None): """ diff --git a/etc/taskcluster/mock.py b/etc/taskcluster/mock.py index 60720f73ddd..bfc963ebaf8 100755 --- a/etc/taskcluster/mock.py +++ b/etc/taskcluster/mock.py @@ -33,12 +33,12 @@ class Index: def findTask(self, path): if decision_task.CONFIG.git_ref == "refs/heads/master": - return {"taskId": ""} + return {"taskId": ""} raise TaskclusterRestFailure stringDate = str -slugId = b"id".lower +slugId = b"".lower Queue = fromNow = MagicMock() sys.modules["taskcluster"] = sys.modules[__name__] sys.dont_write_bytecode = True