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: Ifd69012586ecb59faaab2a474f43efde9b244756
* Add a CoreOS test class TestCoreosKubernetesAPIs
* Add a CoreOS test environment in tox.ini
* Create a base class BaseK8sTest and move OS-agnostic k8s testing
code to that class.
* Increase the disk size from 8G to 10G for m1.magnum and s1.magnum,
since CoreOS image requires more disk space to boot.
* Set os-distro property for CoreOS image.
Partial-Bug: #1546101
Change-Id: Ie56a9442ecebe05f39c7669bc950f5a6ca11df33
The constraints environments are not used at all, they have been
obsoleted everywhere in OpenStack. Remove them completely.
Now the normal jobs can use constraints - as magnum already does.
Change-Id: Iecec444fba59923c7894c1fd2a90aebbfdc4724d
In Ia400b5b6919753d6241233a6666a2c30c7618bc9, we are
adding a new library to global requirements. This
python-k8sclient library essentially has the same
code that was in Magnum so it's a straight replace.
Change-Id: Ib85bcf532e4163d5c1ac95ef701a1ec3133b69eb
Introduce reno to handle release notes as files in-tree.
Also added documentation on how to add re for changes, after this we
will require changes to add reno if they have some significant changes.
Implements: blueprint add-reno-for-release-management
Change-Id: Ifc18b78ab5ce89375b85f6ac4344ffafa7f1c48b
This will force pip install to use the upper-constraints.txt specified
version of pip modules. When you don't do this, you are out on the
bleeding edge and become unstable everytime some python library in the
wide world changes in a way that you don't expect.
Change-Id: I962329075b11d3790dc586ba33fe19fc64f1e4f9
Closes-Bug: #1563038
* Remove bandit.yaml so bandit just uses internal defaults. Results
in much less maintenance.
* Raise the severity level of the scan to just medium and high
* Added nosec to line that makes use of file:// scheme. That support
should probably be droppped at a later time.
* Removed a misleading log message noting what address it was
serving on. Bandit also flagged this as a potential security issue
serving on 0.0.0.0.
Change-Id: I3e08e462255f7b4ba8405d69f5843ed3c001d055
We are going to support python3.4, it's better to add py34 to the
envlist so that devs can fix python3 compatible issues.
Change-Id: I8b478f78c5fd2fb11e6fdcb02bffb10929113a18
Merge bandit job into the voting pep8 target. Pep8 is used here as
general target for lint-like jobs. This will make the bandit job voting.
Looking at recent runs, bandit passes fine, so it's time to enable it.
Once this change is in, the non-voting bandit change can be removed from
OpenStack CI to reduce node usage and the entry in tox.ini can also be
removed.
Change-Id: I9bf1a741336abf830a092f0fb372116d08e6127c
We hard code configure options in tox.ini to generate Magnum config
sample file, and we keep this config sample file in our repository
before.
It is inconvenient for developer if the add/remove/change some
configuration options cause they need to take care about the
config.sample file.
This patch removes magnum.config.sample instead of letting admin generate it
from magnum-config-generator.conf(picked from tox.ini).
P.S. Make tox.ini cleanup since it is not a good idea we mess up tox.ini
with configuration options.
Closes-Bug: #1538374
Change-Id: I80d019b5c98e0282cd0fe50fd4ad66286287e2cb
Instead of getting a DynamicCredentialProvider directly, use the
get_credentials_provider function. This allows for configuration via
TEMPEST_ variables, but the default will still be dynamic credentials.
Only create the default keypair for tests if it doesn't already exist.
Ensure that credentials are freed by calling clear_creds in all cases.
Change-Id: I62ad5ed9fe7c9f6675989df459f92194bb8d67a8
Implements: blueprint magnum-tempest
Once we add debug testenv, we can use "tox -e debug"
to debug test cases when tox is running. Then tox will
use oslotest which really debug our test cases.
Only we should do is insert pdb into code.It's easy to use.
ref:
http://docs.openstack.org/developer/oslotest/debugging.html
Closes-Bug: #1534030
Change-Id: If10634fd0a8c9b9093ccd64f5ba271cf09cfc37c
Fix the ignored E711 hacking rule and remove this exclusion in tox.ini.
This will make Magnum code have no pep8 violations and exceptions.
Change-Id: If7bf9f0cd61cebf2c85011156eb187453578faf7
This patch adds functional testing case for mesos bay creation testing.
1. Add gate_hook.sh to set MAGNUM_GUEST_IMAGE_URL to use ubuntu image
2. Modify post_test_hook to use ubuntu image when doing functional
testing
3. Add new tox env entry to do mesos functional testing.
Partially implements: blueprint mesos-functional-testing
Change-Id: I8ee53de4d34aa79d037901e599fc6409a7de2e72
Since oslo-incubator is no longer maintained[1] after
90ae25e38915cc502d9e9c52d59e8fb668a72ae1. And cliutils.py,_i18n.py are
not referenced by Magnum. Let's remove it.
[1] http://lists.openstack.org/pipermail/openstack-dev/2015-November/
079343.html
Change-Id: Iac3758660209a3983fabe55a279ce72d80286f5e
Closes-Bug: #1529030
This patch will improve tox -e cover when it will be run a summary of
coverage report will be shown afterwards.
Change-Id: I5d10a4ec756dcfea74dfb2bc3d43893caf3f6b26
With this patch it will no longer be required to write each
single proxy variable. It will let pass more variable just
in a single line in future if we add more env variables.
passenv = *_proxy will get all variables like http_proxy,
https_proxy, no_proxy and any_proxy etc.
Change-Id: I8fd137d115380bfeb558706edb52d1ac2d95ca79
Tox does not currently support using factors with sections, and work
towards enabling this has stalled, as such we will need to duplicate
sections adding -constraints to facilitate running sections with the
constrained install_command.
Author: Tom Cammann <tom.cammann@hp.com>
Co-Authored-By: Egor Guz <guz_egor@yahoo.com>
Implements Blueprint: Requirements-Management
Change-Id: Ia36b1794077f29eac189e19552c2d3a4bfe26e5e
We remove old bandit special version txt file and include it
in test-requirements.txt to make sure it can updated by global
automatically.
Change-Id: I03c15eb6d4c1e7a492c37954fce488cbc1fb63d0
This patch adds TestSwarmAPIs test class, aimed to test Docker API/and
swarm related api function, we create a bay while setupClass, and destroy
it after test cases finished. Even without any cased added, at least we can
ensure swarm bay can be created successfully.
This will help to ensure any HOT/yml change won't break swarm's cluster
basic functions.
I leave a todo, we need more works to test container actions.
Since we have created a bay, so we can add more case using magnum client to
test container actions, will do this by followed patch.
Depends-On: Ifa028f6f30b7c2bb7b1dd32b22669379e162c7c5
Partially implements: blueprint swarm-functional-testing
Change-Id: I5c3bc5d7735cce17a45887359d1fb44d12dbba48
This patch splits out api and functional testing case to different directory,
and modify post_test_hook.sh to passing a parameter to calling different tox
venv.
Depends-On: I10e09b2deea7a0643a9516701994cc47813e1aaa
Partially implements: blueprint split-gate-functional-dsvm-magnum
Change-Id: Ic33ea42f6108c7444c152706458cf1a686ed1756
This adds the CORS support middleware to Magnum, allowing a deployer
to optionally configure rules under which a javascript client may
break the single-origin policy and access the API directly.
For magnum, the CORS middleware was directly added to the setup_app
method, as the last middleware to be wrapped around the application
instance. Common headers were added, in order to avoid magic
configuration moments where a feature does not function without
an operator having to read code.
OpenStack CrossProject Spec:
http://specs.openstack.org/openstack/openstack-specs/specs/cors-support.html
Oslo_Middleware Docs:
http://docs.openstack.org/developer/oslo.middleware/cors.html
OpenStack Cloud Admin Guide:
http://docs.openstack.org/admin-guide-cloud/cross_project_cors.html
DocImpact
Change-Id: I7e6d7e2145e3bf883b8a28071c949e10e5c207e0
Closes-bug: #1508209
This patch is mainly porting from nova repository:
Adds:
1.tools/flake8wrap.sh
Will let developer use 'tox -epep8 -- -HEAD' to testing changes files
2.tools/pretty_tox.sh
Give pretty test trace when doing unit/functional testing.
Change-Id: Icedb4ed8b50532531e18784a1584fe63c5a9e017
Reduce cyclomatic complexity of MagnumException to below 10. Remove
exception handling and optimise the logging when the kwargs does not
match the message.
Change-Id: I4fd6ba96be9dff485cdd8bde9750f2d584c1ec63
Closes-Bug: #1501331
The cyclomatic complexity of the setup method was greater than 10 and
reducing this complexity allows for easier understanding of the method.
Change-Id: I45d085d0943fd18a4207fc7a9ba64f2c0f8074ea
Partial-Bug: #1501331
This is method is overly complex and should be broken down. When
reducing the max complexity allowed by flake8 this method was flagged.
Reducing the complexity of this method will allow better testing and
maintenance.
Partial-Bug: #1501331
Change-Id: Id0bdb2d03614ba31de0d96ed09c33695d933b9f7
To allow doc8 testing of the Magnum documentation in CI, doc8 should be
added to the pep8 tox command. After discussion with infra (see change
I6d42cb2092cbaed0cc2ed83f23b7f9ce0b52356f) this has been the suggested
method to allow for doc8 style checking.
As this behaviour is non-obvious I have left the doc8 command in the doc
tox env, this is not run by CI but will be run by users when modifying
and compiling documentation.
Change-Id: I93133e92d792ccc13d61f3ad1281007c2639853b
Two filtering methods had very high cyclomatic complexity, this change
reduces their complexity.
Partial-Bug: #1501331
Change-Id: Idf5dcf83225c35e91cd0fe71eaa7abe32f7f2c6d
This feature is quite useful to detect over-complex code. According to
McCabe, anything that goes beyond 10 is too complex. See
https://en.wikipedia.org/wiki/Cyclomatic_complexity.
Currently the max complexity is 13:
./magnum/service/periodic.py:51:1: C901 'MagnumPeriodicTasks.sync_bay_status' is too complex (11)
./magnum/conductor/handlers/bay_conductor.py:220:1: C901 'HeatPoller.poll_and_check' is too complex (12)
./magnum/common/magnum_keystoneclient.py:97:1: C901 'KeystoneClientV3._v3_client_init' is too complex (10)
./magnum/common/exception.py:192:1: C901 'MagnumException.__init__' is too complex (10)
./magnum/common/utils.py:335:1: C901 'temporary_mutation' is too complex (12)
./magnum/db/sqlalchemy/api.py:125:1: C901 'Connection._add_bays_filters' is too complex (13)
./magnum/db/sqlalchemy/api.py:295:1: C901 'Connection._add_baymodels_filters' is too complex (12)
Setting the max complexity to 14 allows us to not produce anything more
complex. We can work on reducing our complex functions and reducing this
number to 10.
Change-Id: Iaf9c87ecb4873e646d952fd892aafeb7c91fb5e5
Closes-Bug: #1498872
Updated tox.ini and fixed rules.
Fix H405:
Multi line docstring summary not separated with an empty line
Fix E131:
Continuation line unaligned for hanging indent
Change-Id: I20cf75c75cffc434fbdcb05b8e04bffcd4059cd1
Closes-Bug: #1498870
Add doc8 to `tox -edocs` command. doc8 will check syntax/style check
rst documents and fail if not compliant.
Change-Id: Id2e9ed1f96cac27dc5e38f828fd2d824dad31c49
Delete python bytecode before every test run.
Because python creates pyc files during tox runs, certain
changes in the tree, like deletes of files, or switching
branches, can create spurious errors.
Closes-Bug: #1368661
Change-Id: I7e563875848acc7ec767f97b31fc8a95b23ee880
As we have used oslo.policy, so we need to add that in
namespace, as oslo.policy has many settings. This followed
other projects genconfig ways.
Partially-implements: blueprint policy-enforce
Change-Id: I83cce25427b65aad6d26f4ea2d6a48170233a4f3
This patch adds hacking rule check framework for magnum, and adds first rule:
policy.enforce_wsgi decorator must be the first decorator on a method.
refer this link for why we need this rule.
`https://review.openstack.org/#/c/190140/`
Closes-Bugs: #1465895
Change-Id: If98e47426b391b75755ca0b559aee1baa93b8503