[docs][7] Re-design docs to cover all user-groups

Add final 80 symbols margin check, as well as additional check for
trailing spaces. Fix all docs not matching this rule.

Change-Id: I8b4814fad0acaba6ce1de7aa6f90d1f7ecc4153d
This commit is contained in:
Dina Belova 2016-12-09 10:31:04 -08:00
parent d7fdee30cc
commit 2d8e2fc72d
6 changed files with 96 additions and 11 deletions

View File

@ -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.

View File

@ -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: <test_name> is the unit test case name
or
or
.. code-block:: console

View File

@ -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 <contribute>`).
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 <contribute>`).
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:

View File

@ -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 <tutorial_step_6_aborting_load_generation_on_sla_failure>`
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.

View File

@ -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 clouds 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 @@ Lets 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.

View File

@ -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)