From e9b4eb5a2ebb7900e411f4440ca35e0249ea441e Mon Sep 17 00:00:00 2001 From: Anton Studenov Date: Wed, 11 Jan 2017 19:10:26 +0300 Subject: [PATCH] Improve Task status list * Rename old task statuses to the new one "verifying" to "validating", "failed" to "crashed" * Change the type of the status field from the enum to the string in Task and SubTask models Co-Authored-By: Boris Pavlovic Co-Authored-By: Roman Vasilets Change-Id: I3071bd42d9096cb14e6a3c228e1c8dfec81e9c12 --- rally/consts.py | 33 ++++++++++++++++--------------- tests/functional/test_cli_task.py | 2 +- tests/unit/fakes.py | 1 + 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/rally/consts.py b/rally/consts.py index 1adbbfd5..5d76ebca 100644 --- a/rally/consts.py +++ b/rally/consts.py @@ -28,36 +28,37 @@ JSON_SCHEMA = "http://json-schema.org/draft-04/schema" class _TaskStatus(utils.ImmutableMixin, utils.EnumMixin): - # TODO(ikhudoshyn): new statuses - # INIT = "init" - # VALIDATING = "validating" - # VALIDATED = "validated" - # VALIDATION_FAILED = "validation_failed" - # ABORTING = "aborting" - # SOFT_ABORTING = "soft_aborting" - # ABORTED = "aborted" - # CRASHED = "crashed" - # RUNNING = "running" - # FINISHED = "finished" - # TODO(ikhudoshyn): deprecated statuses + """Consts that represents task possible states.""" INIT = "init" - VERIFYING = "verifying" - SETTING_UP = "setting up" + VALIDATING = "validating" + VALIDATED = "validated" + VALIDATION_FAILED = "validation_failed" RUNNING = "running" - CLEANING_UP = "cleaning up" FINISHED = "finished" - FAILED = "failed" + CRASHED = "crashed" ABORTING = "aborting" + SLA_FAILED = "sla_failed" SOFT_ABORTING = "soft_aborting" ABORTED = "aborted" PAUSED = "paused" class _SubtaskStatus(utils.ImmutableMixin, utils.EnumMixin): + + """Consts that represents task possible states.""" + INIT = "init" + VALIDATING = "validating" + VALIDATED = "validated" + VALIDATION_FAILED = "validation_failed" RUNNING = "running" FINISHED = "finished" CRASHED = "crashed" + ABORTING = "aborting" + SLA_FAILED = "sla_failed" + SOFT_ABORTING = "soft_aborting" + ABORTED = "aborted" + PAUSED = "paused" class _DeployStatus(utils.ImmutableMixin, utils.EnumMixin): diff --git a/tests/functional/test_cli_task.py b/tests/functional/test_cli_task.py index 0343451e..9cc27919 100644 --- a/tests/functional/test_cli_task.py +++ b/tests/functional/test_cli_task.py @@ -373,7 +373,7 @@ class TaskTestCase(unittest.TestCase): self.assertIn("finished", rally("task list --deployment MAIN")) self.assertIn("There are no tasks", - rally("task list --status failed")) + rally("task list --status crashed")) self.assertIn("finished", rally("task list --status finished")) diff --git a/tests/unit/fakes.py b/tests/unit/fakes.py index a7c91dfd..b9a3715e 100644 --- a/tests/unit/fakes.py +++ b/tests/unit/fakes.py @@ -1834,6 +1834,7 @@ class FakeTask(dict): self.is_temporary = temporary self.task = task or kwargs self.set_failed = mock.Mock() + self.set_validation_failed = mock.Mock() def __getitem__(self, key): if key in self: