[Core] Introduce class-based scenarios

This adds support of scenarios implemented as classes
in addition to existing method-based scenarios.

First class-based scenario will be added in next patch.

Implements: class-based-scenarios
Change-Id: Ia383226a356cf1b24ac7125c028f547d9de74c0d
This commit is contained in:
Alexander Maretskiy 2016-05-25 15:05:52 +03:00
parent ae3bfea31c
commit 82676b2a94
2 changed files with 11 additions and 6 deletions

View File

@ -1662,6 +1662,14 @@ class FakeScenario(scenario.Scenario):
raise multiprocessing.TimeoutError() raise multiprocessing.TimeoutError()
@scenario.configure(name="classbased.fooscenario")
class FakeClassBasedScenario(FakeScenario):
"""Fake class-based scenario."""
def run(self, *args, **kwargs):
pass
class FakeTimer(rally_utils.Timer): class FakeTimer(rally_utils.Timer):
def duration(self): def duration(self):

View File

@ -200,9 +200,6 @@ class FakeClientsScenarioTestCase(ScenarioTestCase):
self._fake_clients = fakes.FakeClients() self._fake_clients = fakes.FakeClients()
def get_test_context(): def get_test_context(**kwargs):
return { kwargs["task"] = {"uuid": str(uuid.uuid4())}
"task": { return kwargs
"uuid": str(uuid.uuid4())
}
}