diff --git a/doc/feature_request/production_ready_cleanup.rst b/doc/feature_request/production_ready_cleanup.rst index 318518df..62378f35 100644 --- a/doc/feature_request/production_ready_cleanup.rst +++ b/doc/feature_request/production_ready_cleanup.rst @@ -20,7 +20,7 @@ Problem Description There should be few attempts to delete resource in case of failures -* (implemented) Log resources that failed to be deleted +* (implemented) Log resources that failed to be deleted We should log warnings about all non deleted resources. This information should include UUID of resource, it's type and project. diff --git a/doc/source/contribute.rst b/doc/source/contribute.rst index 2d22343a..12bdee8f 100644 --- a/doc/source/contribute.rst +++ b/doc/source/contribute.rst @@ -41,7 +41,8 @@ How to contribute `OpenStack team`_. You can also join the `Rally team`_ if you want to. Make sure Launchpad has your SSH key, Gerrit (the code review system) uses this. -2. Sign the CLA as outlined in the `account setup`_ section of the developer guide. +2. Sign the CLA as outlined in the `account setup`_ section of the developer +guide. 3. Tell git your details: @@ -176,7 +177,7 @@ To debug issues on the unit test: #NOTE: use python 2.7 #NOTE: is the unit test case name - or + or .. code-block:: console diff --git a/doc/source/feature_requests.rst b/doc/source/feature_requests.rst index 101fc971..e15555af 100644 --- a/doc/source/feature_requests.rst +++ b/doc/source/feature_requests.rst @@ -18,9 +18,12 @@ Request New Features ==================== -To request a new feature, you should create a document similar to other feature requests and then contribute it to the **doc/feature_request** directory of the Rally repository (see the :ref:`How-to-contribute tutorial `). +To request a new feature, you should create a document similar to other feature +requests and then contribute it to the **doc/feature_request** directory of the +Rally repository (see the :ref:`How-to-contribute tutorial `). -If you don't have time to contribute your feature request via gerrit, please contact Boris Pavlovic (boris@pavlovic.me) +If you don't have time to contribute your feature request via Gerrit, please +contact Boris Pavlovic (boris@pavlovic.me) Active feature requests: diff --git a/doc/source/quick_start/tutorial/step_4_adding_success_criteria_for_benchmarks.rst b/doc/source/quick_start/tutorial/step_4_adding_success_criteria_for_benchmarks.rst index eef7683e..689a985d 100644 --- a/doc/source/quick_start/tutorial/step_4_adding_success_criteria_for_benchmarks.rst +++ b/doc/source/quick_start/tutorial/step_4_adding_success_criteria_for_benchmarks.rst @@ -160,5 +160,5 @@ pages: Success criteria present a very useful concept that enables not only to analyze the outcome of your benchmark tasks, but also to control their execution. In :ref:`one of the next sections ` -of our tutorial, we will show how to use SLA to abort the load generation before -your OpenStack goes wrong. +of our tutorial, we will show how to use SLA to abort the load generation +before your OpenStack goes wrong. diff --git a/doc/source/quick_start/tutorial/step_6_aborting_load_generation_on_sla_failure.rst b/doc/source/quick_start/tutorial/step_6_aborting_load_generation_on_sla_failure.rst index 420229fd..4fd2ff93 100644 --- a/doc/source/quick_start/tutorial/step_6_aborting_load_generation_on_sla_failure.rst +++ b/doc/source/quick_start/tutorial/step_6_aborting_load_generation_on_sla_failure.rst @@ -19,7 +19,7 @@ Step 6. Aborting load generation on success criteria failure ============================================================ Benchmarking pre-production and production OpenStack clouds is not a trivial -task. From the one side it is important to reach the OpenStack cloud’s limits, +task. From the one side it is important to reach the OpenStack cloud's limits, from the other side the cloud shouldn't be damaged. Rally aims to make this task as simple as possible. Since the very beginning Rally was able to generate enough load for any OpenStack cloud. Generating too big a load was the major @@ -139,9 +139,9 @@ Let’s run it! :align: center This time load stopped after 1410 iterations versus 2495 which is much better. -The interesting thing on this chart is that first occurrence of “> 10 second” -authentication happened on 950 iteration. The reasonable question: “Why does -Rally run 500 more authentication requests then?”. This appears from the math: +The interesting thing on this chart is that first occurrence of "> 10 second" +authentication happened on 950 iteration. The reasonable question: "Why does +Rally run 500 more authentication requests then?". This appears from the math: During the execution of **bad** authentication (10 seconds) Rally performed about 50 request/sec * 10 sec = 500 new requests as a result we run 1400 iterations instead of 950. diff --git a/tests/unit/doc/test_format.py b/tests/unit/doc/test_format.py new file mode 100644 index 00000000..2f126d36 --- /dev/null +++ b/tests/unit/doc/test_format.py @@ -0,0 +1,81 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import fnmatch +import io +import os +import re + +import testtools + + +class TestFormat(testtools.TestCase): + def _check_lines_wrapping(self, doc_file, raw): + code_block = False + text_inside_simple_tables = False + lines = raw.split("\n") + for i, line in enumerate(lines): + if code_block: + if not line or line.startswith(" "): + continue + else: + code_block = False + if "::" in line: + code_block = True + # simple style tables also can fit >=80 symbols + # open simple style table + if ("===" in line or "---" in line) and not lines[i - 1]: + text_inside_simple_tables = True + if "http://" in line or "https://" in line or ":ref:" in line: + continue + # Allow lines which do not contain any whitespace + if re.match("\s*[^\s]+$", line): + continue + if not text_inside_simple_tables: + self.assertTrue( + len(line) < 80, + msg="%s:%d: Line limited to a maximum of 79 characters." % + (doc_file, i + 1)) + # close simple style table + if "===" in line and not lines[i + 1]: + text_inside_simple_tables = False + + def _check_no_cr(self, doc_file, raw): + matches = re.findall("\r", raw) + self.assertEqual( + len(matches), 0, + "Found %s literal carriage returns in file %s" % + (len(matches), doc_file)) + + def _check_trailing_spaces(self, doc_file, raw): + for i, line in enumerate(raw.split("\n")): + trailing_spaces = re.findall("\s+$", line) + self.assertEqual( + len(trailing_spaces), 0, + "Found trailing spaces on line %s of %s" % (i + 1, doc_file)) + + def test_lines(self): + + files = [] + docs_dir = os.path.join(os.path.dirname(__file__), os.pardir, + os.pardir, os.pardir, "doc") + for root, dirnames, filenames in os.walk(docs_dir): + for filename in fnmatch.filter(filenames, '*.rst'): + files.append(os.path.join(root, filename)) + + for filename in files: + with io.open(filename, encoding="utf-8") as f: + data = f.read() + + self._check_lines_wrapping(filename, data) + self._check_no_cr(filename, data) + self._check_trailing_spaces(filename, data)