232 Commits

Author SHA1 Message Date
Sean McGinnis
5542de51bc Be explicit about tox python version
We want to default all jobs to use python 3 except for
the ones that use explicit versions. Unfortunately, the
current tox behavior for setting basepython to python3
is not intuitive.

If the system default is python 3.5, then when basepython
is set to python3, both the py35 and py36 targets will
end up running with python 3.5.

To get around this we need to not set a default base
version and explicitly set each testenv to python3 that
we want to run using 3 instead of 2 but do not really
care which minor version is used.

Change-Id: I3971eeafbd1e732a584b0c52d2eb6c2175b709aa
2018-06-13 16:54:35 -05:00
Zuul
b711c8da16 Merge "Run pylint job under py3" 2018-06-12 16:00:08 +00:00
Zuul
a8578bd488 Merge "Default tox jobs to python3" 2018-06-12 15:43:38 +00:00
junboli
1268872774 Add check to the flake8 job
Follow up recommendation of [1].
[1] http://lists.openstack.org/pipermail/openstack-dev/2018-June/131233.html

Change-Id: Id268be8b32ce870f2f04fa8a52f4f1854a613fa7
2018-06-07 19:48:57 +08:00
Sean McGinnis
d675de18de Run pylint job under py3
This switches the pylint target to run under python3. In
order to work right, it also raises the version of pylint
used to a newer version.

Related-bug: #1761800

Change-Id: I0bc68a5aee24a53b9d3a08c20549b89d08989678
2018-06-06 16:28:34 -05:00
Sean McGinnis
37510ac034 Default tox jobs to python3
The long term goal for OpenStack is to support python3 for
all things except explicit python2 testing by the T release.
Part of preparing for that is ensuring all ancillary things
like docs jobs and other tooling work with python3.

This switches the default for our docs jobs to python3 so
anything that does not specify another version will end up
using it.

Further work is necessary for the pylint job due to changes
between the runtimes. That will be done in a follow up patch.

There was also a difference in behavior with the genopts job
where it ends up trying to recreate the venv under which it
is currently running under, resulting in a corrupted venv
and a failure. This cleans up that script and changes it so
rather than a tox job calling a tox job it just runs the
script.

Change-Id: Ie79528b33070e6c60f9f5e1f2219084a2f0cb039
2018-06-05 14:16:34 -05:00
Zuul
1ca6ab6ffa Merge "Remove stale pip-missing-reqs tox test" 2018-05-10 18:45:59 +00:00
Zuul
603589e54f Merge "Default pep8/fast8 to run under python 3" 2018-05-10 18:40:27 +00:00
fpxie
99119568b0 Remove stale pip-missing-reqs tox test
pip_missing_reqs tool is no longer maintained and has broken with release 10 of pip

Refer to:
  http://lists.openstack.org/pipermail/openstack-dev/2018-April/130027.html

Change-Id: Iaa65b1789590e85602e7a63ca4e80cd087b05693
2018-05-07 15:20:18 +08:00
Sean McGinnis
7745ff3944 Test running jobs under py36/bionic
Change-Id: I2036f9be98f76cba21180d74dbde1050c3359234
2018-04-26 08:56:55 -05:00
Zuul
08fb43e805 Merge "add lower-constraints job" 2018-04-10 20:59:01 +00:00
Zuul
b9a0a64211 Merge "Use sphinxcontrib.apidoc for module docs" 2018-04-10 05:20:37 +00:00
Eric Harney
bae574d0c9 Add doc to pep8 check_exec
Detect executable files in doc/source.

Change-Id: I43894faacdec839cc61bfb7db675f33cbc5d454d
2018-04-09 14:42:05 -04:00
Doug Hellmann
6a8ebbc1ae 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: I329e6364d537f2acac796e389f15f3c7162a9244
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-07 21:23:14 -04:00
Sean McGinnis
cb1a05a2c2 Default pep8/fast8 to run under python 3
There are slight differences with pep8 when run under python 3.
It is a little more strict on certain things, plus we want to
get to just supporting python 3 eventually, so this switches
over the pep8 and fast8 targets to use python 3.

Change-Id: I3212bfb2dd173e79dae6d548827a803f68923da9
2018-04-05 19:47:50 -05:00
Sean McGinnis
3b34019f0b Use sphinxcontrib.apidoc for module docs
Now that sphinxcontrib.apidoc is available, we should get rid of
the custom code we have for generating this information ourselves.
This also cleans up some really stale docs that are no longer
needed.

Change-Id: Iaa9fecc2478326b45b67a2cfd98de5f93f537efe
2018-04-05 14:36:03 -05:00
Sean McGinnis
e68fba2b09 Fix doc format errors in module docstrings
This fixes some formatting issues in docstrings to allow us
to enable the warnings-as-errors flag for our docs build.

Co-authored by: Jay S. Bryant <jungleboyj@electronicjungle.net>

Change-Id: I9567e232686d8775ff67418e8333c164f8acd8f3
2018-03-28 17:05:07 -05:00
Zuul
c0b8de28e4 Merge "Enable hash randomization in unit tests" 2018-02-22 04:56:52 +00:00
Eric Harney
52965d8974 Enable hash randomization in unit tests
This is needed to ensure that unit tests match how
deployed environments run.

Related-Bug: #1348818
Related-Bug: #1658725
Related-Bug: #1715915

Depends-On: I91a53fdef98c9a14ccc536403063e228e99d6971
Depends-On: Ie548c90f5657e5270fd966207f453d5211e21867
Depends-On: I754d48d8bc4081b96fdf90465c4897d0fadd6262
Depends-On: Ia8762aff6fd9954d350310b4c68ee4fe94de68bf
Depends-On: I6fe0ae5da270d9c77cb248551dcb32a5c063977a
Depends-On: I96b9b413387f2ef02ea7ccfb6e676cad0b87c6f1
Depends-On: Icdde5e3f213adfe4893d1b9e8f2bfe4f61704037
Depends-On: I29a874ebe0ebaeca58b428faa0bab50482baf6f1
Depends-On: I30817ae767e08c45f9540b19e922864fe2f7a9c2
Depends-On: I281ad59fa518f936aa8d1b518acf61800ba949f5
Depends-On: I0abd0415306c0c0544eb5d9a6ed08640ff6bb0cf
Depends-On: I599b585444cbd51182d9f17fddd97bd91637e1e3
Depends-On: I6e4093ca8e79128ed23a4d5068e5d2870e16332c
Depends-On: I574dca83a971e746a54895a87e394befda0ccdcf
Depends-On: Id5a961c66a62e289a96daa7437374768ef407bb6
Depends-On: Ibc6c20e6ffce58c6bbef3155f73e54909d76e132
Change-Id: I4c7396f9d8e58ac8420754503f8ed60cd7473426
2018-02-20 12:20:58 -05:00
Eric Harney
0368192a1f Fix find -delete race in tox
If you launch py35 and py27 envs from the same
directory simultaneously, the find -delete commands
here will race against each other and cause a
failure.

Set the find option to ignore readdir races.

Change-Id: I4977ad687150b5a1d6f09a961fca4db5d768ef71
2018-02-19 13:07:39 -05:00
Eric Harney
12b6ccc804 Run doc8 first
For "tox -e docs", run doc8 first.

doc8 runs much faster than sphinx builds and
will provide quick feedback on syntax issues.

Change-Id: Id4f77020a70acd8eb9df513d43f86d9fe78f7e22
2018-01-23 17:06:53 +00:00
jiansong
f877ec2917 Follow the new PTI for document build
For compliance with the Project Testing Interface as described in:

https://governance.openstack.org/tc/reference/project-testing-interface.html

For more detials information, please refer to:

http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Change-Id: I84e614346cfa4d302f919d12bea9680c5e527475
2017-12-20 18:24:11 -08:00
Sean McGinnis
6d36629294 Add output of slowest tests to UT runs
With the switch to stestr we lost the automatic output of the slowest
tests. We can still get that output, but it is a separate command to
run after the tests. Add that to our tox.ini command for test execution.

Change-Id: I37937c1ebe4a10b896f1deb77f64b520ceba2830
2017-12-11 10:25:29 -06:00
Zuul
8751b5dc8a Merge "Remove doc/build before running docs job" 2017-10-27 00:19:44 +00:00
junboli
b7048784b1 Remove doc/build before running docs job
Clear doc/build directory before running docs job may better guarantee
each building output the newest docs.

Change-Id: I17537742a4c1421f2bd0561d2c48c5ae56d89026
2017-10-25 08:21:05 +00:00
TommyLike
988f79479e Add policy documentation and sample file
This patch adds documentation and sample
file for default policy in code feature.

Change-Id: I597971a29ec61a1bf8c991b2715ec7644b2e2692
Partial-Implements: blueprint policy-in-code
2017-10-20 10:47:34 +08:00
j-griffith
f93bc791bf Switch from ostestr to stestr
This change just updates the tox.ini file to call stestr directly
instead of going through ostestr.

For more background you can read the ML posting:
    https://goo.gl/TFvcxy

So now you won't need `--n` to run single tests, and you can also
supply regex directly without even the `--`.  For example:
  `tox -epy27 $regex`

Change-Id: I75d4ca19f87fe1930cf54b554b7e232632a4a21c
2017-10-15 15:02:55 +00:00
Sean McGinnis
676195e009 Add .stestr.conf configuration
os-testr has moved over to use stestr instead of testr. While this
is usually compaible with existing settings, there is a warning
that is emitted when .stestr.conf is not present. It is usually
able to fall back to parsing the .testr.conf file, but to be more
correct and to prevent future problems we should update the config.

Change-Id: I11e43cff87cad20b9c880e276e20a04123f830fb
2017-10-10 00:46:42 +00:00
Jenkins
e912ced6e1 Merge "[policy in code] Add support for attachment resource" 2017-10-08 11:01:53 +00:00
TommyLike
43a3152581 [policy in code] Add support for attachment resource
This is the basic patch which consits of the framework
code for default policy in code feature as well as
support in attachment resource.

Change-Id: Ie3ff068e61ea8e0e8fff78deb732e183e036a10c
Partial-Implements: blueprint policy-in-code
2017-09-26 03:19:20 +00:00
Sean McGinnis
604529a160 Clear cached autogenerated docs before docs build
Leftover data in the autogenerated docs can result in build
failure. Remove these files before every build to be safe.

Change-Id: Iec3ff7334b7af80cb34019590544fab0b1c95240
Closes-bug: #1716478
2017-09-20 12:36:30 -05:00
Eric Harney
d3abafdee4 Move config-generator to tools
Moving this out of cinder/ separates it from the
actual run-time Cinder code.

Change-Id: I056f40120fdef60a0dc1a5926729748fd2835938
2017-08-16 16:18:48 -04:00
Eric Harney
6460050c5c Add releasenotes to check_exec list
Prevent addition of executable files in
the releasenotes/notes directory.

Change-Id: I80ac0b7fce7b16a453fe9139f0dacf88325af8e7
2017-08-16 15:50:44 -04:00
Jay S. Bryant
429281bee2 Ignore all .egg-info directories in doc8 check
Doc builds can fail if you have .egg-info directories
in your repo.  This change makes sure that those
directories are ignored in the doc8 check.

Change-Id: I8e713651919f43feb80fca59b74c103b3255dd75
2017-07-13 10:43:56 -05:00
Ngo Quoc Cuong
8ca93ac3f7 Enable H904 check
H904  String interpolation should be delayed to be handled by the
logging code, rather than being done at the point of the logging call.
Use ',' instead of '%'.

See: https://docs.openstack.org/oslo.i18n/latest/user/guidelines.html#adding-variables-to-log-messages

Change-Id: Ib5781b837ba60028dce6dddd5b198647e002c8f1
2017-07-05 21:27:05 -04:00
jeremy.zhang
85a1b8d40b Enable some off-by-default checks
Some of the available checks are disabled by default in flake8, like:
[H106] Don’t put vim configuration in source files
[H203] Use assertIs(Not)None to check for None

This patch is to enable the H106 and H203 checks in Cinder project.
The C312 hacking rule will be removed when turn on H203.

Change-Id: I2e883c301b64d5977bbb907b63c9c144bc6f959d
2017-06-22 02:17:54 +00:00
Dirk Mueller
2db0497fde Add a local bindep.txt override
This avoids falling back to the global bindep-fallback.txt which
installs a pretty big environment. Without this change, a lot
of additional but unnecessary packages are installed on the nodepool
workers.

Change-Id: I8c581225eada929bc947b13f851bb228000f32fe
2017-05-25 23:27:10 +02:00
Jenkins
67fc1f76b4 Merge "Add bandit-baseline to tox.ini" 2017-03-29 22:29:40 +00:00
Nicholas Jones
2bec754d50 Add bandit-baseline to tox.ini
To add a bandit gate, a new tox environment is needed

Change-Id: If247add30d8dc4761dacb82c8d02ea4bd71546f0
2017-03-29 10:55:25 -05:00
Eric Harney
52e0f003fb Revert "Remove v1 API reference"
The v1 API is still in the tree, even if it is off by
default and deprecated.  We need to keep documentation on
how it works at least until we remove the code.  This was
published to [1] which was the primary way to find this
information, and it is now missing.

[1] https://developer.openstack.org/api-ref/block-storage/v1/

This marks v1 as deprecated in the toctree.

This reverts commit 8139f7f108786112ec6eef47228ecbc7f54b6f47.

Change-Id: Ic9d0fcce5ca0f8455c212292664b8f9694edfce3
2017-03-15 17:04:22 -04:00
Jenkins
d9278b5a60 Merge "Remove support for py34" 2017-02-17 10:29:04 +00:00
Danny Al-Gaaf
e3e749fa30 doc: verify all rst files
Make use of doc8 to verify all rst files which are not
autogenerated for errors and fail if there are any issues
found. The doc8 checks are now part of the tox 'docs'
environment and ran automatically. Checks can also be called
direcly via 'tox -e docs'.

Fix all issues found by doc8.

Closes-Bug: #1566765

Change-Id: I2b25247030a1aadcfe029c9e071ef17f2f72046b
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2017-02-14 12:36:57 +01:00
yanjun.fu
69c24cd5f4 Remove support for py34
The gating on python 3.4 is restricted to <= Mitaka. This is due to
the change from Ubuntu Trusty to Xenial, where only python3.5 is
available. There is no need to continue to keep these settings.

Change-Id: Ief6f4b8b37113f08dd0ae767f3dd2b5b2177e3ce
2017-02-08 17:32:00 +08:00
xianming mao
dbf61cdb4a 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.

Note: this copy from 1be35ff039d67c50866f2556ef847b048cbf3578

Change-Id: I7c6106149832d048d4d3bd2701c2c0db81bd87cb
2017-01-05 12:22:22 +00:00
Jeremy Liu
45bfe2ecd5 Fix warning when running tox -e docs
We get a warning "WARNING:test command found but not installed in testenv"
when building docs. This patch fix it.

Change-Id: Ib9798e59c55099d5a4bf8989401b63487b0c6338
2016-12-13 17:30:47 +08:00
Sean McGinnis
ca0786778c Switch default py3x to py35
Per our conversation in the Cinder weekly meeting [1] we will
now switch to just running local tests against python 3.5 as
that is the more recent and common 3.x version available on new
distros. Other versions can still be run explicitly, but this
changes the default tox run to only use 3.5.

[1] http://eavesdrop.openstack.org/meetings/cinder/2016/cinder.2016-11-30-16.00.log.html#l-54

Change-Id: If2226cb229f016e36c4dfab6224d5ae353b926bb
2016-12-09 14:22:28 -06:00
Michał Dulko
792108f771 Remove ovo[fixtures] dependency from tox.ini
Looks like we should now be able to add oslo.versionedobjects[fixtures]
to test-requirements.txt and remove it from tox.ini, so this commit does
that.

Change-Id: I420ea16d8ad6d883e7c2c8de80f912ea35500367
2016-09-28 18:31:49 +02:00
Jenkins
bd63288029 Merge "Let setup.py compile_catalog process all language files" 2016-09-08 05:01:36 +00:00
Jenkins
aeabde14f3 Merge "Use constraints for api-ref environment" 2016-08-30 23:14:39 +00:00
Jenkins
226dd7c8c1 Merge "Add functional-py35 to tox" 2016-08-28 19:23:47 +00:00