If there is no api reference for some placement API method
tox -e placement-api-ref will fail now.
Change-Id: Ifefedcd51f1f8d5e741ef6d02b7a0879a185e05f
In an environment where http_proxy env variable is needed to buil a
proper python virtualenv the functional test fails with:
RuntimeError: http_proxy or https_proxy set in environment, please unset
This patch removes passing proxy env varibles in tox.ini to avoid this
error.
Change-Id: Ia4d8fe952aecb5c3e688878ef0fdafd6fac4fc7a
Closes-Bug: #1706545
As pep8 does not run on doc generation python code so we have some
style violations there. As it not too hard to fix the problems and
therefore enable pep8 on these files this patch proposes such a
change.
Change-Id: I26104ea66fc4f3e67f8227025f43202e483beb25
Some time ago the placement-api-ref source structure was changed
(Ia2fd62ae7f401cad34ee7c2b355c9a5ab1c93f6b) to use inc-files istead of
putting all in index.rst, but that change broke placement_api_docs.py.
This change modifies placement_api_docs.py to go through all *.inc files
in placement-api-ref directory and scan for the "rest method" header.
Change-Id: I60150ab51173934f848662499dcf6af18625697e
This continues to make wrong guesses in many environments, and it only
slows down running pep8. Do not have this in the tree.
Change-Id: Ia63a279685160157385cc231c4b6dc2243f31d01
This consists of a duplicate of the [nova-]api-ref setup and
conf.py along with tooling to fail the tox -edocs target when
a route that is defined in
nova.api.openstack.placement.handler.ROUTE_DECLARATIONS is not
present in placement-api-ref/source/index.rst.
tools/placement_api_docs.py will report which routes are missing.
Though completely gameable (as demonstrated in the current lame
index.rst) it's better than nothing and provides some useful
structuring on what to do next. It's also the case that the 'docs'
target in tox is not part of gating.
The response for GET / is in place with the necessary
parameters.yaml for it to be correctly described. The 'get-root.json'
file provides the JSON of the expected response. The expectation is
that later commits will add information for other urls and their
JSON files will be named method-path-separated-by-dash.json with a
request/response qualifier as necessary.
Followup patches will add other routes.
A new parameters.yaml is used instead of reusing the one from
api-ref as there isn't a lot of expected overlap and having a
separate file will ease eventual extraction.
Running tox -eplacement-api-ref will generate the docs for review,
with output in placement-api-ref/build/html/index.html.
This will be hooked up with CI to deploy the generated docs,
eventually.
Change-Id: Ifb4d91d39db0e49b55952e37cdfc9f63dcd37aa3
Change 98cbf72e57 handled this for
the py35 target but missed the functional-py35 target because
that one doesn't inherit the commands from the root testenv.
Change-Id: I018b809488f9e979f334c75415c15acb58dbd782
Related-Bug: #1229445
Specify 'nova' as the name of the application for the flake8-import-order
plugin. That way it knows that imports of nova should come after external
libraries.
Fix issues discovered in ordering by this new check.
Change-Id: I822796ba3d750f93de813035aeee59e8ccb022a2
- When flake8-import-order is installed the additional
ordering tests it provides are enabled by default.
- When devstack installs python projects from source
such as nova, the pip_install function installs both the
requirements.txt and test-requiremets.txt dependencies systemwide.
As a result, any python project that runs pep8 tests without a
python virtual environment will also have import ordering enforced
which may fail.
- This change removes flake8-import-order from the
test-requirements.txt to prevent failures in projects other
than nova that don't enforce pep8 import ordering.
Change-Id: I994df178f0000a0840f6658ccc2f277d5503f826
The pep8 target has the little known "-HEAD" argument
which makes it only run flake8 on the changes since the
last change in the history.
Even though that's nice, it's sometimes hard to remember
the -HEAD argument. Plus pep8 is running some other
checks on things like the docs.
So if all you want is the pep8 -- -HEAD behavior, this
is a simplied convenient form of it.
Change-Id: I97b277d8ac95ca3ef8379570e0e3886df26263e1
The docs job is not run in the gate, meaning invalid JSON files with
\r\n line endings are able to sneak in. Duplicate the checks from the
docs environment to the pep8 environment so that gate jobs run it.
Note that pep8 is our general linting target and thus should include
these kind of tests.
Change-Id: Ie923902b04be79b9f66ba1841c60899a413f6439
Closes-Bug: #1673131
Use the flake8 plugin flake8-import-order to check import ordering. It
can do it automatically and don't need reviewers to check it.
Change-Id: Ia3d81bbbb44b40804b3268c0e648276a36cb4805
Existance of this file causes py3* tests to fail if
run after py27. This patch adds cleaning up of this
file before running py3* tests.
Change-Id: I64ef1eac7f05f217674c73ddd2cc3af773dd75ce
Closes-Bug: #1229445
Use ostestr as runner instead of the custome pretty_tox.sh script
(pretty much removed everywhere). pretty_tox3.sh is just a wrapper
for ostestr but it could be probably removed as well going forward.
Also remove the tempest-lib dependency, which originally provided
subunit-trace (now from os-testr).
Change-Id: I4390964ce83167d634b80f696e82a0e199582ce6
In this patchset, I set up 'enabled-extensions' in flake8 section
of tox.ini. In newer hacking versions, we can enable some of the
non-default hacking rules (one by one), which are disabled by default
and implemented in the newer versions of hacking. The enabled extensions
are the following:
* [H106] Don’t put vim configuration in source files (off by default).
* [H203] Use assertIs(Not)None to check for None (off by default).
* [H904] Delay string interpolations at logging calls (off by default).
Together with enabling these rules, I also removed the locally
implemented versions of them. Due to limitations of local checking
engine, there were some places in the tests, where pep8 failed.
In this patchset, these codes are also fixed.
Change-Id: I3a9d2dc007a269cdb2cad441e22f5eb9b58ce0a0
Now that there exists only a gate job for Python 3.5 and not 3.4,
we should remove those references to the 3.4 that is untested.
Change-Id: I4716c12a29427d2d101eb5527eb08096c147f333
* Add osprofiler wsgi middleware. This middleware is used for 2 things:
1) It checks that person who want to trace is trusted and knows
secret HMAC key.
2) It starts tracing in case of proper trace headers
and adds the first wsgi trace point with info about the HTTP request
* Add initialization of osprofiler on start of a service
Currently that includes oslo.messaging notifier instance creation
to send Ceilometer backend notifications.
oslo-spec: https://review.openstack.org/#/c/103825/
python-novaclient change: https://review.openstack.org/#/c/254699/
based on: https://review.openstack.org/#/c/105096/
Co-Authored-By: Boris Pavlovic <boris@pavlovic.me>
Co-Authored-By: Munoz, Obed N <obed.n.munoz@intel.com>
Co-Authored-By: Roman Podoliaka <rpodolyaka@mirantis.com>
Co-Authored-By: Tovin Seven <vinhnt@vn.fujitsu.com>
Implements: blueprint osprofiler-support-in-nova
Change-Id: I82d2badc8c1fcec27c3fce7c3c20e0f3b76414f1
The nova/tests/functional/api_sample_tests/test_servers.py contains the
ServersSampleBase class, and in its class definition creates a
'user_data' attribute by base64 encoding a string. However, this will
not work in Python 3, as the base64.b64encode() method requires bytes,
not a string. As a result, importing the test class fails and no tests
get run.
Note that this change doesn't fix all tests to work under Python 3; it
simply fixes the bug that prevents the tests from running at all under
Python 3.
Closes-Bug: #1632856
Change-Id: I35a7b02132bed0387a173b339f6204bf0e3269de
This reverts commit 1e287ae14b
Constraints mechanism doesn't work for 'hacking' lib:
I11eb0d762869ad8920795fb710f1b2eeb9354f12
We have to install all of test-requirements to get
'hacking' at the right version.
Closes-Bug: #1648054
Change-Id: I512192e8a9ab3a53a52e6cc4d4b8a222951af7fb
The docs testenv doesn't work with python 3.x on our codebase.
If someone is on a platform that defaults to python => python3,
building docs will fail for them.
Closes-Bug: #1646629
Change-Id: I56f3933e89e6fe9e181517325e2d7af5110c5656
Naming envs like this is breaking the current
oslo periodic day job; a simple way to unbreak this
is to name them explicitly (which appears to be
more common).
So this changes the command listing to do just that
as well as lists py35 in the envlist (because its
a valid target).
Change-Id: I2a162604b60df8f18ff53069c6bf99cfecc4217e
The oslotest package distributes a shell file that may be used to assist
in debugging python code. The shell file uses testtools, and supports
debugging with pdb. Debug tox environment implements following test
instructions.
https://wiki.openstack.org/wiki/Testr#Debugging_.28pdb.29_Tests
To enable debugging, run tox with the debug environment. Below are the
following ways to run it.
* tox -e debug module
* tox -e debug module.test_class
* tox -e debug module.test_class.test_method
Change-Id: I08937845803be7bd125b838ab07bda56f202e88d
Closes-Bug: 1632486
The functional testenv doesn't work with python 3.x on our codebase.
If someone is on a platform that defaults to python => python3,
functional tests will fail for them.
Closes-Bug: #1632521
Change-Id: I7bf6653f55c10d0a4f75054e519edf7da19c5c09
The cover job runs the unit tests and having stale
pycs can skew those results, so remove the pyc files
before running the tests with --coverage.
Change-Id: I7393d2df36e715dbf53ba9ae6a077bdc8e79b5a5
This reverts commit 0d6d1616b9.
The PYTHONDONTWRITEBYTECODE setting is ignored in post-v1.6.0 versions
of tox due to issues with setuptools [1]. Suffer the performance hit.
[1] https://tox.readthedocs.io/en/latest/changelog.html#id21
Change-Id: I99d165f0cc4f5382aef72f21f31bc985585f4748
When bumping nova object versions, it's necessary to generate new
hashes for those that have changed. New hashes are generated when the
GENERATE_HASHES environment variable is set. Let tox copy GENERATE_HASHES
to the test environment to allow object hash generation for a command
line like:
GENERATE_HASHES=1 tox -epy27
Change-Id: Id652a7a9fbaeaf35db06744cbaf2484504fc2531