From 98dc6b9a7ab9d25bcf2e46de71e6cc1a40e80f8d Mon Sep 17 00:00:00 2001 From: Boris Pavlovic Date: Sun, 23 Nov 2014 22:35:52 +0400 Subject: [PATCH] Rename rally-scenarios to rally-jobs & add readme This patch renames misleading rally-scenarios to rally-jobs. rally-jobs describes much better purpose of this directory Add readme files that describes structure and meanings of files and directories Change-Id: I8f5a2816186a2cafd251981ba7ad50e631e548f5 Closes-bug: #1395502 --- rally-jobs/README.rst | 40 +++++++++++++++++++ rally-jobs/extra/README.rst | 6 +++ .../extra/instance_dd_test.sh | 0 .../extra/server_with_ports.yaml.template | 0 .../extra/server_with_volume.yaml.template | 0 rally-jobs/plugins/README.rst | 9 +++++ .../plugins/fake_plugin.py | 0 .../rally-designate.yaml | 0 .../rally-neutron.yaml | 0 .../rally-zaqar.yaml | 0 {rally-scenarios => rally-jobs}/rally.yaml | 0 tests/ci/rally-gate.sh | 12 ++++-- .../__init__.py | 0 .../test_jobs.py} | 15 +++---- 14 files changed, 72 insertions(+), 10 deletions(-) create mode 100644 rally-jobs/README.rst create mode 100644 rally-jobs/extra/README.rst rename {rally-scenarios => rally-jobs}/extra/instance_dd_test.sh (100%) rename {rally-scenarios => rally-jobs}/extra/server_with_ports.yaml.template (100%) rename {rally-scenarios => rally-jobs}/extra/server_with_volume.yaml.template (100%) create mode 100644 rally-jobs/plugins/README.rst rename {rally-scenarios => rally-jobs}/plugins/fake_plugin.py (100%) rename {rally-scenarios => rally-jobs}/rally-designate.yaml (100%) rename {rally-scenarios => rally-jobs}/rally-neutron.yaml (100%) rename {rally-scenarios => rally-jobs}/rally-zaqar.yaml (100%) rename {rally-scenarios => rally-jobs}/rally.yaml (100%) rename tests/unit/{rally_scenarios => rally_jobs}/__init__.py (100%) rename tests/unit/{rally_scenarios/test_scenarios.py => rally_jobs/test_jobs.py} (72%) diff --git a/rally-jobs/README.rst b/rally-jobs/README.rst new file mode 100644 index 0000000000..6a9050769e --- /dev/null +++ b/rally-jobs/README.rst @@ -0,0 +1,40 @@ +Rally job related files +======================= + +This directory contains rally tasks and plugins that are run by OpenStack CI. + +Structure +--------- + +* plugins - directory where you can add rally plugins. Almost everything in + Rally is a plugin. Benchmark context, Benchmark scenario, SLA checks, Generic + cleanup resources, .... + +* extra - all files from this directory will be copy pasted to gates, so you + are able to use absolute paths in rally tasks. + Files will be located in ~/.rally/extra/* + +* rally.yaml is a task that is run in gates against OpenStack (nova network) + +* rally-neutron.yaml is a task that is run in gates against OpenStack with + Neutron Service + +* rally-designate.yaml is a task that is run in gates against OpenStack with + Designate Service. It's experimental job. To trigger make a review with + "check experimental" text. + +* rally-zaqar.yaml is a task that is run in gates against OpenStack with + Zaqar Service. It's experimental job. To trigger make a review with + "check experimental" text. + + +Useful links +------------ + +* More about Rally: https://rally.readthedocs.org/en/latest/ + +* How to add rally-gates: https://rally.readthedocs.org/en/latest/rally_gatejob.html + +* About plugins: https://rally.readthedocs.org/en/latest/plugins.html + +* Plugin samples: https://github.com/stackforge/rally/tree/master/doc/samples/plugins diff --git a/rally-jobs/extra/README.rst b/rally-jobs/extra/README.rst new file mode 100644 index 0000000000..aab343c51d --- /dev/null +++ b/rally-jobs/extra/README.rst @@ -0,0 +1,6 @@ +Extra files +=========== + +All files from this directory will be copy pasted to gates, so you are able to +use absolute path in rally tasks. Files will be in ~/.rally/extra/* + diff --git a/rally-scenarios/extra/instance_dd_test.sh b/rally-jobs/extra/instance_dd_test.sh similarity index 100% rename from rally-scenarios/extra/instance_dd_test.sh rename to rally-jobs/extra/instance_dd_test.sh diff --git a/rally-scenarios/extra/server_with_ports.yaml.template b/rally-jobs/extra/server_with_ports.yaml.template similarity index 100% rename from rally-scenarios/extra/server_with_ports.yaml.template rename to rally-jobs/extra/server_with_ports.yaml.template diff --git a/rally-scenarios/extra/server_with_volume.yaml.template b/rally-jobs/extra/server_with_volume.yaml.template similarity index 100% rename from rally-scenarios/extra/server_with_volume.yaml.template rename to rally-jobs/extra/server_with_volume.yaml.template diff --git a/rally-jobs/plugins/README.rst b/rally-jobs/plugins/README.rst new file mode 100644 index 0000000000..33bec0d253 --- /dev/null +++ b/rally-jobs/plugins/README.rst @@ -0,0 +1,9 @@ +Rally plugins +============= + +All *.py modules from this directory will be auto-loaded by Rally and all +plugins will be discoverable. There is no need of any extra configuration +and there is no difference between writing them here and in rally code base. + +Note that it is better to push all interesting and useful benchmarks to Rally +code base, this simplifies administration for Operators. diff --git a/rally-scenarios/plugins/fake_plugin.py b/rally-jobs/plugins/fake_plugin.py similarity index 100% rename from rally-scenarios/plugins/fake_plugin.py rename to rally-jobs/plugins/fake_plugin.py diff --git a/rally-scenarios/rally-designate.yaml b/rally-jobs/rally-designate.yaml similarity index 100% rename from rally-scenarios/rally-designate.yaml rename to rally-jobs/rally-designate.yaml diff --git a/rally-scenarios/rally-neutron.yaml b/rally-jobs/rally-neutron.yaml similarity index 100% rename from rally-scenarios/rally-neutron.yaml rename to rally-jobs/rally-neutron.yaml diff --git a/rally-scenarios/rally-zaqar.yaml b/rally-jobs/rally-zaqar.yaml similarity index 100% rename from rally-scenarios/rally-zaqar.yaml rename to rally-jobs/rally-zaqar.yaml diff --git a/rally-scenarios/rally.yaml b/rally-jobs/rally.yaml similarity index 100% rename from rally-scenarios/rally.yaml rename to rally-jobs/rally.yaml diff --git a/tests/ci/rally-gate.sh b/tests/ci/rally-gate.sh index 741cd58ecb..0f7396393b 100755 --- a/tests/ci/rally-gate.sh +++ b/tests/ci/rally-gate.sh @@ -15,9 +15,15 @@ # This script is executed by post_test_hook function in desvstack gate. PROJECT=`echo $ZUUL_PROJECT | cut -d \/ -f 2` -SCENARIO=$BASE/new/$PROJECT/rally-scenarios/${RALLY_SCENARIO}.yaml -PLUGINS_DIR=$BASE/new/$PROJECT/rally-scenarios/plugins -EXTRA_DIR=$BASE/new/$PROJECT/rally-scenarios/extra + +RALLY_JOB_DIR=$BASE/new/$PROJECT/rally-scenarios +if [ ! -d $RALLY_JOB_DIR ]; then + RALLY_JOB_DIR=$BASE/new/$PROJECT/rally-jobs +fi + +SCENARIO=${RALLY_JOB_DIR}/${RALLY_SCENARIO}.yaml +PLUGINS_DIR=${RALLY_JOB_DIR}/plugins +EXTRA_DIR=${RALLY_JOB_DIR}/extra RALLY_PLUGINS_DIR=~/.rally/plugins diff --git a/tests/unit/rally_scenarios/__init__.py b/tests/unit/rally_jobs/__init__.py similarity index 100% rename from tests/unit/rally_scenarios/__init__.py rename to tests/unit/rally_jobs/__init__.py diff --git a/tests/unit/rally_scenarios/test_scenarios.py b/tests/unit/rally_jobs/test_jobs.py similarity index 72% rename from tests/unit/rally_scenarios/test_scenarios.py rename to tests/unit/rally_jobs/test_jobs.py index b521f626e3..8ffd887a29 100644 --- a/tests/unit/rally_scenarios/test_scenarios.py +++ b/tests/unit/rally_jobs/test_jobs.py @@ -23,17 +23,18 @@ import rally.utils as rutils from tests.unit import test -class ScenarioTestCase(test.TestCase): - rally_scenarios_path = os.path.join( - os.path.dirname(__file__), "..", "..", "..", "rally-scenarios") +class RallyJobsTestCase(test.TestCase): + rally_jobs_path = os.path.join( + os.path.dirname(__file__), "..", "..", "..", "rally-jobs") @mock.patch("rally.benchmark.engine.BenchmarkEngine" "._validate_config_semantic") def test_schema_is_valid(self, mock_validate): - rutils.load_plugins(os.path.join(self.rally_scenarios_path, "plugins")) + rutils.load_plugins(os.path.join(self.rally_jobs_path, "plugins")) - for filename in ["rally.yaml", "rally-neutron.yaml"]: - full_path = os.path.join(self.rally_scenarios_path, filename) + for filename in ["rally.yaml", "rally-neutron.yaml", + "rally-zaqar.yaml", "rally-designate.yaml"]: + full_path = os.path.join(self.rally_jobs_path, filename) with open(full_path) as task_file: try: @@ -43,4 +44,4 @@ class ScenarioTestCase(test.TestCase): eng.validate() except Exception: print(traceback.format_exc()) - self.fail("Wrong scenario config %s" % full_path) + self.fail("Wrong task input file: %s" % full_path)