From 63618c81a5649bd92015de2e4651d98c9ef7edca Mon Sep 17 00:00:00 2001 From: Boris Pavlovic Date: Sun, 14 May 2017 21:43:57 -0700 Subject: [PATCH] Remove old way to describe scenario plugin via method Initally Rally scenario plugins were methods of speical class. However to unify scenarios with other plugins we moved to model where plugin is class. We have a bunch of code that was used for transition and backward compatiblity that we can finally remove. Change-Id: Ia6841068eb1d5a39a8f64f160160f1fcc1e05ac5 --- rally-jobs/plugins/fake_plugin.py | 4 ++-- tests/functional/extra/fake_dir1/fake_plugin1.py | 7 +++---- tests/functional/extra/fake_dir2/fake_plugin2.py | 7 +++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/rally-jobs/plugins/fake_plugin.py b/rally-jobs/plugins/fake_plugin.py index 2076e930..f2abef8f 100644 --- a/rally-jobs/plugins/fake_plugin.py +++ b/rally-jobs/plugins/fake_plugin.py @@ -24,6 +24,7 @@ from rally.task import scenario from test_relative_import import zzz +@scenario.configure(name="FakePlugin.testplugin") class FakePlugin(scenario.Scenario): """Fake plugin with a scenario.""" @@ -35,8 +36,7 @@ class FakePlugin(scenario.Scenario): def _test2(self, factor): time.sleep(random.random() * factor) - @scenario.configure() - def testplugin(self, factor=1): + def run(self, factor=1): """Fake scenario. :param factor: influences the argument value for a time.sleep() call diff --git a/tests/functional/extra/fake_dir1/fake_plugin1.py b/tests/functional/extra/fake_dir1/fake_plugin1.py index 2f113fa1..4d2c1a49 100644 --- a/tests/functional/extra/fake_dir1/fake_plugin1.py +++ b/tests/functional/extra/fake_dir1/fake_plugin1.py @@ -16,10 +16,9 @@ from rally.task import scenario +@scenario.configure(name="FakeScenarioPlugin1.list") class FakeScenarioPlugin1(scenario.Scenario): - """Sample fake plugin.""" - @scenario.configure() - def list(self): - """Fake scenario.""" + def run(self): + """Sample fake scenario.""" pass diff --git a/tests/functional/extra/fake_dir2/fake_plugin2.py b/tests/functional/extra/fake_dir2/fake_plugin2.py index bf70f1c5..e380842c 100644 --- a/tests/functional/extra/fake_dir2/fake_plugin2.py +++ b/tests/functional/extra/fake_dir2/fake_plugin2.py @@ -16,10 +16,9 @@ from rally.task import scenario +@scenario.configure(name="FakeScenarioPlugin2.list") class FakeScenarioPlugin2(scenario.Scenario): - """Sample fake plugin.""" - @scenario.configure() - def list(self): - """Fake scenario.""" + def run(self): + """Sample fake scenario.""" pass