71 Commits

Author SHA1 Message Date
Michael Johnson
5a780519b4 Add coverage.xml output for PTI compliance
The OpenStack Python testing interface specifies that coverage jobs
are required to output a coverage.xml[1]. This patch adds that output.

[1] https://governance.openstack.org/tc/reference/pti/python.html \
    #coverage-jobs

Change-Id: Id88a612fcdb84186e7da6b02b85ab00e3289052e
2018-05-23 10:07:49 -07:00
huangshan
f8ec935b0f Fix releasenotes build in tox
This patch is to ensure the old files are not left over
when running these document builds.

Change-Id: Ia69f470e8cfb1a830b08f0076547465cf6cf624a
2018-05-22 18:45:12 +08:00
Michael Johnson
592d1790c7 Set lower-constraint to run unit and functional
This sets up the lower-constraint tox environment to run both the unit and
functional tests. This should provide better coverage.

Change-Id: Ibef3a77ccdd5ee19ead8f9932f58f96b61ed7aa5
2018-03-28 17:23:01 -07:00
Doug Hellmann
ca6ef769a0 add lower-constraints job
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.

Create a lower-constraints.txt to be used to enforce the lower bounds
in those tests.

Add openstack-tox-lower-constraints job to the zuul configuration.

See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.

Change-Id: I39bf164b6852a94d1d98d73c45b2e30c37e8971b
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-27 04:51:00 +00:00
Carlos Goncalves
d871c2a7fb Reduce stestr concurrency to 1 for tempest jobs
The switch from ostestr to stestr introduced in Change-Id
Ie6a275170ec6faf0db3976410660f52078710a54 missed setting concurrency
jobs to 1 for api and scenario tests, leading to intermittent gate
issues.

This patch also fixes coverage test that got broken in the
aforementioned Change-Id.

Change-Id: I077330ad6f0308845d1b5330040be6f92c39580d
2018-03-14 02:50:02 +00:00
Jacky Hu
649b33d247 Add license for empty __init__.py
This also fix build-openstack-sphinx-docs, there was a change introduced
in sphinx 1.6.6:
https://github.com/sphinx-doc/sphinx/pull/4335/files

If the size of __init__.py is less than 2, then the module would be
skipped which will cause the sphinx consistency checking failing later.

Change-Id: I9d8764b6e907aceed8bb8a9b04711145d0eb32ad
2018-03-14 07:02:56 +09:00
Carlos Goncalves
7f3506b295 Migrate to stestr
This patch updates tox.ini to directly call stestr instead of ostestr
[1]. ostestr is no longer installed by default by infra.

For more info on stestr, please refer to [2].

[1] http://lists.openstack.org/pipermail/openstack-dev/2017-September/122135.html
[2] http://stestr.readthedocs.io/en/latest/MANUAL.html

Depends-On: https://review.openstack.org/#/c/550282/
Change-Id: Ie6a275170ec6faf0db3976410660f52078710a54
2018-03-07 11:57:31 +00:00
Zuul
4955d15c16 Merge "Enable hacking-extensions H204, H205" 2018-02-09 01:19:56 +00:00
Michael Johnson
c548c21c3f Fix release notes job
Recently there have been a few changes to the release notes and docs jobs.
This patch returns a blank line after the release notes ToC on the index page
and updates the release notes tox job to use the new docs requirements.txt

Change-Id: I0ab2545a670a65853a9f37564d700c945d3a5092
2018-02-07 09:21:46 -08:00
Luong Anh Tuan
5f9c2c3c59 Enable hacking-extensions H204, H205
This patch enable extensions:
- H204: Use assert(Not)Equal to check for equality.
- H205: Use assert(Greater|Less)(Equal) for comparison.

Change-Id: I2db8cbbfda6d57321372fb3d1238d3f9fb05545a
2018-02-07 16:06:39 +00:00
chengebj5238
66a7e6138f Repalce Chinese quotes to English quotes
Change-Id: Idcd0cdb57019a512f2d3eecdb7bc2b08a34af7e8
2018-02-05 18:39:02 +08:00
Michael Johnson
711f6159c1 Update api-ref for uuid type and fix tox
The API reference documentation theme now supports the "uuid" type[1].
This patch updates the Octavia API reference to use the uuid type where
appropriate to clarify the type.

This patch also fixes the api-ref tox target for the new documentation
requirements.txt file.

[1] https://review.openstack.org/#/c/528597/

Change-Id: Ia7dfe2a26140fba0208531bd8e8e82163eb75347
2018-02-03 21:38:12 +00:00
Monty Taylor
967edebe0c Change how path munging works for sphinx docs
The 'import tools' line is fragile as it depends on how things are
executed as to whether or not '.' is in the python path.

Do the sphinx path munging before importing it.

Also, remove reference to modules/autoindex which does not exist and
thus causes sadness from warning-is-error.

Moves documentation requirements into doc/requirements.txt

Depends-On: Ib121961c5a953a434e7b333cd70f7838a2671f69
Change-Id: I23691aa1d0ea038ec1215e6199015529ddd92de4
2017-12-21 11:00:13 -08:00
Michael Johnson
f7bc994819 Have doc8 ignore autodoc content
Sphinx autodoc is genereating titles that are too long do to the depth of
the module paths in octavia. This patch tells doc8 to ignore the auto
generated content.

Change-Id: I63333dad11a35a2e62569549b07c2e6a99b4e192
2017-12-07 16:38:11 -08:00
chenghuiyu
49404342ec Enable some off-by-default checks
Some of available checks are disabled by default,
like:[H106] Don’t put vim configuration in source
files[H203] Use assertIs(Not)None to check for None

Change-Id: I3891fb42fe26d0edfbf85fddd2da5d8ff7739202
story: 2001301
task: 5852
2017-11-23 03:40:48 +08:00
Dong Jun
344b8fa871 Support pylint
Support pylint for octavia, some harmless rules are added to messages
control group.

Change-Id: I88577b1ab918fc7a19b2323ca652bde7ffad64ef
2017-10-16 09:32:41 +08:00
Jenkins
1421d451ee Merge "Use flake8-import-order plugin" 2017-09-20 21:47:10 +00:00
Nir Magnezi
4f7c541793 Use flake8-import-order plugin
This addition automates the process, as opposed to relying on review inputs.
Inspired by Ib51bd97dc4394ef2b46d4dbb7fb36a9aa9f8fe3d

Change-Id: I1d6051cf6678b6d5db774fc884390fec626c1f2c
2017-09-19 05:42:07 +00:00
Adam Harwell
8f381e8d39 Gatefix: Migrate from testr to stestr
Change-Id: I7339874be54b29a7eba9933c534445899b6fb8c1
2017-09-13 17:12:21 +00:00
Michael Johnson
c34bd5c399 Move doc-requirements to test-requirements
The Octavia project was an oddity by having a seperate doc-requirements
file from test-requirements. This means we don't get global requirements
updates for our docs modules. With the new openstackdocstheme, keeping these
modules up to date is becoming more important.
This patch removes the doc-requirements file, removes unnecessary requirements,
and moves the modules still required into test-requirements.

Change-Id: Ida43b61b7e471f1be96b56056ed2d789b270c0cf
2017-08-17 21:13:12 -07:00
Ngo Quoc Cuong
b3506fa3eb Enable H904 check
H904 allows the logging package to skip creating the formatted log
message if the message is not going to be emitted because of the
current log level.

Change-Id: Id6e27d8fefacd93bde41db21a20c8eaf3d3d6880
See: https://docs.openstack.org/oslo.i18n/latest/user/guidelines.html#adding-variables-to-log-messages
2017-07-06 04:00:49 -04:00
Michael Johnson
8987ab39ed Add RBAC enforcement to pools v2 API
This patch adds policies and enforcement to the Octavia v2 API for pools.

It also fixes a minor issue with the specs tox job.

Change-Id: Id2aa4dfad149583f9cb16205cb617f6e2a1bc92e
Partial-Bug: #1690481
2017-06-20 09:38:29 -07:00
Michael Johnson
0ce46fe8d0 Add RBAC enforcement to Octavia v2 API
This patch adds policies and enforcement to the Octavia v2 API for
load balancers and listeners.  Child patches will add the rest of the API.

In this patch I also correct some improper functional tests.

Change-Id: Id8a2d15c117c54bd45fc8bb76bf71aff1b3c8fe9
Closes-Bug: #1690481
2017-06-20 13:43:47 +03:00
Adam Harwell
49d0085f57 Add check O346 to disallow backslash line continuation
Also remove our own check that we were ignoring.

Change-Id: Icc8d74f0ee85df742340dc147b9252eaa3eaa739
2017-06-06 15:54:38 -07:00
Jenkins
3c1bfbf44b Merge "Fix the coverage HTML report" 2017-04-27 01:34:41 +00:00
German Eichberger
e07c872441 Fixes mysterious gdbm error
This patch uses the line from
https://git.openstack.org/cgit/openstack/magnum/commit/?id=20a5de74e7fb3a6e973b52e34dbba938b5e3000d
to fix the problems described in
https://bugs.launchpad.net/testrepository/+bug/1229445

Change-Id: I2f0d23e547284eb1bf671e69a262e60d91d7d81a
2017-04-24 16:37:23 -04:00
Michael Johnson
d70b1d6da0 Fix the coverage HTML report
The coverage job is only showing partial results in the HTML version
of the report.  This patch corrects that by generating an HTML report
with the combined results.

Change-Id: I66b563d8d17a982ec3701626e8ac60c52a01a363
2017-04-23 11:14:21 -07:00
Jenkins
75cdd31f88 Merge "Adjust tox cover to check for 80% coverage" 2017-04-20 14:05:21 +00:00
M V P Nitesh
e89a679965 Fix doc generation for Python3
Fix the Sphinx html_last_updated_fmt for Python3.
The html_last_updated_fmt option is interpeted as a
byte string in python3, causing Sphinx build to break.
This patch makes it utf-8 string.

Change-Id: I6cde9bb1f815bae91378772626142dd7645188d7
2017-04-19 12:48:03 +05:30
Michael Johnson
e9f52d7853 Adjust tox cover to check for 80% coverage
In preparation for adding coverage to the octavia check gate,
adjusts the cover tox job to check for 80% coverage.

Change-Id: Ifa924da594af53d07f156aa0ffbb870389dcb513
2017-04-18 15:29:59 -07:00
Ankur Gupta
dd689f3592 Introduce TESTING.rst for quick developer reference
Change-Id: Ie714d1a5d4cdf16ca3ad216b7729b8529d8038b9
2017-04-07 21:48:31 +00:00
ckji
7abcee0c80 change genconfig output-file path
Because original directory 'etc/octavia' does not exist, excuting
'tox -egenconfig' fail with 'No such file or directory'.

Change-Id: I1b26bc1e631d1280dab223b1271362100347fe82
2017-03-28 09:15:41 +08:00
Michael Johnson
7fdc8a1e06 Update for new pep8 rules E402 and W503
Change-Id: I181f396b002d0c3b89579c4fc33c34b1c099953e
2017-03-10 22:21:39 +00:00
Adam Harwell
cf9a8c8f77 Look for diskimage-builder not dib-utils when building amps
Also ignore E402 and W503 pep8 issues

Change-Id: I7937d0a21c7a748cd682511bd429de8cf0ffe498
2017-03-09 02:30:39 +00:00
Jenkins
d5e72bcef8 Merge "Remove python3.4 from tox" 2017-02-14 17:33:13 +00:00
johnsom
5b72c134a9 Create api-ref base for Octavia
This patch will create the initial directory and index for the api reference
documentation (using the new guidelines) for the Octavia API.

Change-Id: Id5fbe569acfe7348f4f9dfc9cbef49834ea824c3
Partial-Bug: #1558385
2017-02-13 23:08:14 +00:00
Michael Johnson
e251016191 Remove python3.4 from tox
The Consistent Testing Interface (CTI) [1] does not list python3.4
testing as needed for OpenStack Python 3 support.  This patch removes
the unnecessary Python 3.4 tests from our tox configuration.

[1] https://governance.openstack.org/tc/reference/cti/python_cti.html

Change-Id: I4d9b72f7ad83c4d41ce364a1d0253c358537e64c
2017-01-24 14:16:00 -08:00
Gary Kotton
4edcf3a8df Add context to unit tests
When running the unit tests we will now see which tests is being
run and the status of the test in question. This will help debugging,
triaging and cleaning things up.

Change-Id: I6d1458654d2fb6a8e814b17c4673bb9337fac4ec
2017-01-01 01:50:56 -08:00
Michael Johnson
ad828709a7 Setup translation for octavia
This patch sets up octavia for translations.
It also includes some additional pep8 tests borrowed from neutron
that will be used in the future (tempest idempotent ids and policy.json)

Change-Id: Ia70506fa8cfdbcea7cc67b940761365093e94f2b
2016-12-15 00:48:02 +00:00
Michael Johnson
7d3a0f3670 Fix to run functional tests
After the scenario test merge [1] our functional tests were no longer
being run by the py* tests.  This patch adds a functional test
environment and updates the cover environment to include the
functional test coverage.

[1] https://review.openstack.org/172199

Change-Id: If6b1de66ed441e0c05cc8daf640b6e713d7e0708
Closes-Bug: #1630012
2016-10-11 17:51:08 +00:00
ptoohill1
5e774f373a Octavia: Basic LoadBalancer Scenario Test
TESTING: Devstack plugin changes to run scenarios

Adds: Structure for tempest testing
Adds: Required tempest files and configuration for tempest testing
Adds: Octavia clients for communication with the API
Adds: Utilities for tempest testing
Adds: Mock session in method test_update_health_no_status_change of test_update_db

Co-Authored-By: Franklin Naval <franklin.naval@gmail.com>
Co-Authored-By: Madhusudhan Kandadai <madhusudhan.openstack@gmail.com>
Co-Authored-By: min wang <swiftwangster@gmail.com>

Change-Id: Ifd821ad0d94131e7dc42f2a52746ec094cf4153e
2016-09-23 22:50:05 +00:00
Stephen Balukoff
26ab83e9aa Add tox 'specs' test to pep8 environment
It turns out the gate doesn't actually use tox for the docs test,
so in order to catch errors in specs, this commit moves the tox
specs testing to the pep8 environment, where the gate actually does
use tox for the test.

Change-Id: I660d360eed5b109c85d7ba73d421d3973c96c452
2016-09-09 11:10:30 -07:00
Paul Glass
e291a88210 Stop using bandit-baseline
bandit-baseline finds *new* issues introduced in a commit, by comparing
results between two git commits. If the git repository has uncommitted
changes, bandit-baseline refuses to run.

This switches over to using plain bandit instead of bandit-baseline,
and resolves or stifles existing bandit errors so we have a clean run.
These updates apply to bandit running as part of `tox -e pep8` or `tox
-e bandit`.

* Have bandit runs from tox ignore the octavia/tests directory
* Resolve several instances of `B701 jinja2_autoescape_false`
* Stifle several instances of `B303 md5`
* Resolve two instances of `B104 hardcoded_bind_all_interfaces`
* Stifle one instance of `B104 hardcoded_bind_all_interfaces` (see
https://bugs.launchpad.net/octavia/+bug/1489963)

Closes-Bug: #1621251
Related-Bug: #1489963

Change-Id: Iad3cbe5762949a6311bdd361b1f12c5a24c40633
2016-09-09 14:50:20 +00:00
Stephen Balukoff
0a4764f7b7 Update tox 'docs' environment to test specs
This commit updates the tox 'docs' environment to also run our specs
tests, so that the existing docs gate merge jobs will catch any specs
that get added but don't follow the template.

This commit also updates the specs test to suppress warnings for
:doc: references in specs.

Change-Id: Ie7dda124a0c964712b1a02b55730a76fa346111e
Closes-Bug: #1621648
2016-09-08 15:18:43 -07:00
Andreas Jaeger
d7146de5e8 Move bandit to pep8
The bandit gate is passing, let's make it voting.

Since bandit is a security linter, add it to the linter target - called
pep8 - and run it there. This will save the CI systems spawning an extra
test machine for this.

This is the recommended approach in OpenStack CI to run all linters as
part of pep8 target - see also the consistent testing interface for
python (http://governance.openstack.org/reference/cti/python_cti.html)
that associates pep8 with "Codestyle checks".

Change-Id: Id65a50c35723b79e9b92952d138e60ee998c341c
2016-09-02 17:45:44 +02:00
AvnishPal
13f2b1ede1 Use upper constraints for all jobs in tox.ini
Openstack infra now supports upper constraints for
all jobs. Updated tox.ini to use upper constraints
for all jobs.

Change-Id: I1f31ac2761e793a7831676de520de08497e2fb95
Closes-Bug: #1614361
2016-08-23 09:24:16 +05:30
Michael Johnson
bc2e9beb3a Adds a process to generate key flow documentation
Octavia extensively uses TaskFlow flows for orchestration.
To make it easier for developers to understand these flows,
this patch adds a mechanism for generating graphviz representations
of the key Octavia TaskFlow flows.
It also updates our tox docs task to generate this documentation.

This patch depends on a fix to the TaskFlow export_to_dot method.

Added into conf.py as first step of configuration

Closes-Bug: #1561063
Change-Id: I914e1c062b400148565def37ccf618b3d2ea2573
Depends-On: I99f87af0b2bed959fcb43ef611b3186e23bd9549
2016-08-10 21:39:38 +00:00
Henry Gessau
bd9d7a02b4 Enable DeprecationWarning in test environments
Many deprecations are triggered early (on imports, for example)
before the warnings are enabled by the WarningsFixture in the
base test class.

To make sure all DeprecationWarning messages are emitted we enable
them via the PYTHONWARNINGS environment variable.

Change-Id: Iaa71926035889763ee733fe64ea2336d326faa5f
2016-08-09 19:00:22 -04:00
Yatin Kumbhare
db2178964a Add Python 3.5 classifier and venv
Now that there is a passing gate job, we can claim support for
Python 3.5 in the classifier. This patch also adds the convenience
py35 venv.

Change-Id: I968c8baab6b9f5c1b1b99735e16dc08158f7d8d7
2016-07-12 21:12:59 +05:30
Gary Kotton
18b2f02676 Tox: Remove exclude directories that no longer exist
Remove directories that no longer exist in the project,
for example openstack/common. This is now part of libraries
that are imported.

TrivialFix

Change-Id: I5e8abb022686c581e5faa8063b7497582122cc3e
2016-06-06 06:15:47 -07:00