Commit Graph

49 Commits

Author SHA1 Message Date
Zuul 5fe13f681e Merge "Clean up tox.ini" 2023-09-13 08:42:37 +00:00
Jake Yip 31a6c8fc43 Use TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is deprecated [1]

[1] https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file

Change-Id: I1a6362909c457c140a8eafa476bb525ee1d006e1
2023-09-08 03:31:50 +00:00
Jake Yip 13cafc1061 Clean up tox.ini
install_command is now `python -I -m pip install <opts> <packages>`
[1], so this is redundant.

[1] https://tox.wiki/en/latest/config.html#install_command

Change-Id: Ia856c7ecff22bc6f0dffed7550618decbc213e97
2023-02-16 11:57:39 +00:00
Jake Yip 4d74c31c9a Support tox4
Renamed deprecated option whitelist_externals to allowlist_externals.

Bumped tox minversion as allowlist_externals is only supported in
3.18 [1].

Also set skipsdist=False (default) due to [2].

[1] https://tox.wiki/en/3.24.5/config.html#conf-allowlist_externals
[2] https://github.com/tox-dev/tox/issues/2730

Change-Id: Iee2f00418804c21589bd8abc19a8b25aff458e77
2023-02-16 16:27:03 +11:00
wangzihao f80cd3c859 Remove pypy and bump py37 to py38
Pypy is not tested in OpenStack anymore,remove the job.

in 'victoria' cycle, we should test py38 by default.
and remove redundant python env.

Change-Id: I8389799ebf2eaa95324b1dc532ef4398ee3094da
2022-09-26 14:09:11 +00:00
Ghanshyam Mann 78ca45caa3 Drop lower-constraints.txt and its testing
As discussed in TC PTG[1] and TC resolution[2], we are
dropping the lower-constraints.txt file and its testing.
We will keep lower bounds in the requirements.txt file but
with a note that these are not tested lower bounds and we
try our best to keep them updated.

[1] https://etherpad.opendev.org/p/tc-zed-ptg#L326
[2] https://governance.openstack.org/tc/resolutions/20220414-drop-lower-constraints.html#proposal

Change-Id: I7e70c45ecd294dfd7610f446ff1f382c590f9d64
2022-04-30 20:24:10 -05:00
Andreas Jaeger 5d93b51900 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 2.0 which
supports Python 3.

Fix problems found.

Change-Id: I81cf5e317bb2f791888e75d87cfd27dfdd2b5f96
2020-03-28 15:54:06 +01:00
Feilong Wang de2b8e88b0 Drop py27 tests
Task: 39089
Story: 2007437

Change-Id: I3d311f457307a75a3e9167768ae5e0c1d47d9566
2020-03-18 13:18:30 +13:00
jacky06 69be0ac44e Replace git.openstack.org URLs with opendev.org URLs
1. Replace git.openstack.org URLs with opendev.org URLs
2. bump tox minversion to 2.0 to keep consistence with magmum[1]

[1]: https://github.com/openstack/magnum/blob/master/tox.ini#L2

Change-Id: Iddc8ca8de4451b7a152f5526ff9f25794dde734e
Closes-Bug: #1826698
2019-08-24 02:04:03 +00:00
Corey Bryant a19d01355f Add Python 3 Train unit tests
This is a mechanically generated patch to ensure unit testing is in place
for all of the Tested Runtimes for Train.

See the Train python3-updates goal document for details:
https://governance.openstack.org/tc/goals/train/python3-updates.html

Change-Id: I6bed1f2df2c50234657112869b585439afa1b550
Story: #2005924
Task: #34219
2019-07-05 11:51:52 -04:00
Jake Yip 440f4b12fc Fix coverage test
The coverage test has been broken since forever [1].

Fix it by updating coverage test to how other projects do it [2][3].

[1] https://zuul.openstack.org/builds?job_name=openstack-tox-cover&project=openstack%2Fpython-magnumclient
[2] https://github.com/openstack/nova/blob/stable/stein/tox.ini#L152-L167
[3] https://github.com/openstack/cinder/blob/stable/stein/tox.ini#L99-L110

Change-Id: I3090e9d9b31dc668d177771de3cf1a8f3ea91ae8
2019-06-03 19:34:36 +10:00
Ghanshyam Mann 9f5b8c790a Dropping the py35 testing
All the integration testing has been moved to
Bionic now[1] and py3.5 is not tested runtime for
Train or stable/stein[2].

As per below ML thread, we are good to drop the py35
testing now:
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/005097.html

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004647.html
[2]
https://governance.openstack.org/tc/reference/runtimes/stein.html
https://governance.openstack.org/tc/reference/runtimes/train.html

Change-Id: I90b3d96348fede667b9895f87e879a816420216a
2019-04-14 23:03:13 +00:00
Vieri 07b83c21d7 add python 3.6 unit test job
This is a mechanically generated patch to add a unit test job running
under Python 3.6 as part of the python3-first goal.

See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html

Change-Id: I48b1eda5ac2960fb13eaba39550d5ae3bc567281
Story: #2002586
2018-11-28 07:09:04 +00:00
Feilong Wang c026a13e15 Add release notes for magnum client
Change-Id: If1cc736ed8ef2949744efec755492d05388077f7
2018-08-20 10:28:21 +12:00
Vu Cong Tuan 3e728f945f Switch to stestr
According to Openstack summit session [1],
stestr is maintained project to which all Openstack projects should migrate.
Let's switch to stestr as other projects have already moved to it.

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: I1c4aaa0e0909f5272ab970950e3d21662dee2227
2018-07-24 15:44:42 +07:00
Doug Hellmann 5c157edc88 fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: Id03d28442b998624153e048ad9a621f31dbdb7d2
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 17:58:18 -04:00
Nguyen Hai 2b8c717440 Follow the new PTI for document build
For compliance with the Project Testing Interface as described in:
[1] https://governance.openstack.org/tc/reference/project-testing-interface.html
[2] http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Remove the '[build_sphinx]' and '[pbr]' sections as described in:
http://lists.openstack.org/pipermail/openstack-dev/2018-March/128594.html

Change-Id: I65b35db580e029bb0639c7b4bd1cb7c3b0395542
2018-03-27 13:50:16 +09:00
Doug Hellmann 989b5e7eec 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: I673d98410d124d082272a7ba23836eb2e818f3e9
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-22 17:52:18 -04:00
Andreas Jaeger 7e4c28b499 Avoid tox_install.sh for constraints support
We do not need tox_install.sh, pip can handle constraints itself
and install the project correctly. Thus update tox.ini and remove
the now obsolete tools/tox_install.sh file.

This follows https://review.openstack.org/#/c/508061 to remove
tools/tox_install.sh.

Change-Id: I21b90d9976d410d92194ab292c11bf972af1479c
2017-12-05 12:49:24 +00:00
Feng Shengqin 1f5819fcf7 Move cover.sh to the tools directory
Change-Id: Ief705106c158792491437825bed410e37270a147
2017-03-20 19:34:20 +08:00
kavithahr 44ae7822a7 The python 3.4 support is removed
The python 3.5 version is available, hence removed
python 3.4 version.

Change-Id: Ie164ec36d8e84ad3b46456b7ca358e6d4b272ba1
2017-03-09 14:17:16 +00:00
yatin 77a169d3c7 Compare test coverage with the master branch
* checkout one commit before the latest and check coverage
* check coverage with the latest commit
* all new lines must be tested

This functionallity essentially compares the current change
with the master branch, since the coverage job runs always
for only one change.

Change-Id: I59b03d5c5e69a36b5fac9fef0576a29a885a5bba
Partially-Implements: blueprint magnumclient-ut-coverage
2017-02-17 14:30:21 +05:30
Jenkins f9b150086d Merge "Enable DeprecationWarning in test environments" 2017-01-23 17:19:30 +00:00
Jenkins 86e4395a25 Merge "delete python bytecode including pyo before every test run" 2017-01-23 17:16:39 +00:00
pawnesh.kumar d1a6a7fc49 Enable DeprecationWarning in test environments
Many deprecations are triggered early (on imports, for example).
To make sure all DeprecationWarning messages are emitted we enable
them via the PYTHONWARNINGS environment variable.

Change-Id: Ic523b37b39c33746adc372b2f20f7d211ac76dd8
2016-10-26 13:30:20 +05:30
Lucky samadhiya 9f44c3e6ff delete python bytecode including pyo before every test run
Change-Id: Ib1a4b29ed7873773f60b5daaf66aa29c9fd967fb
2016-09-16 12:53:18 +05:30
yatin karel 6c7f8088fa Use testr coverage feature
Removed coverage.sh script and used testr to generate
coverage report.

Change-Id: I05d446addf89c59c96ed92e6a3728776ccc1da94
Closes-Bug: #1614124
2016-08-17 20:16:27 +05:30
yatin karel 5b0f60a5f6 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: I2c47f1a19c61a2b2034cf38100b87ddc62a93cfe
Closes-Bug: #1614117
2016-08-17 20:05:33 +05:30
PanFengyun 3ab2958073 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: Idafad48f97dc4ddcb63d217aa64f61cf236a7833
2016-07-28 14:08:08 +00:00
Hongbin Lu 8679d8d12c Completely remove openstack common modules
Since we already copy magnumclient/openstack/common modules
to magnumclient/common directory and updated all users to
use the new located modules:
https://review.openstack.org/#/c/280050/
https://review.openstack.org/#/c/283936/

There is a previous patch trying to remove the unuse modules:
https://review.openstack.org/#/c/281039/

However, that patch has been reverted since it breaks Heat:
https://review.openstack.org/#/c/288534/

Now, it seems Heat has fixed that:
https://review.openstack.org/#/c/306338/

Change-Id: If8bfcadf1c417e15a6927daf49bc4773bff51417
Closes-Bug: #1545957
2016-06-08 10:58:32 -05:00
Niall Bunting 4935c0f187 Tox test should respect upper-constraints
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
world changes in a way that you don't expect.

Change-Id: I175240a59ee7ee9562db96ddf73d402c703f8e20
Closes-Bug: #1563038
2016-05-25 13:50:28 +00:00
Eric Brown a5381cdd2f Remove bandit.yaml in favor of defaults
This patch removes the bandit.yaml and just uses whatever Bandit
defaults with in the scan. This cuts down on the maintenance of
the burdensome bandit.yaml file.

This patch also changes the severity level of the scan to just
medium and high issues.

Here are the results without the -ll to exclude low severity:
http://paste.openstack.org/show/489898/

Change-Id: Ia063db516175f518cfa1c68902b8b74734f294c0
2016-03-09 11:47:06 -08:00
Andreas Jaeger 44a8121400 Move bandit into pep8
The non-voting bandit job is running stable, let's make it voting now.

Run security linter bandit as part of pep8. Pep8 is the usual linter
target and thus let's use it there instead of starting another node for
this short-running job.

Change-Id: Ia6183592f4623e62b1882b2ee549ba3c35f823fb
2016-02-24 21:55:55 +01:00
Jenkins 0bdbb05ae3 Merge "Revert "Pass environment variables of proxy to tox"" 2016-01-25 08:50:35 +00:00
Doug Hellmann 50b610df76 Revert "Pass environment variables of proxy to tox"
It looks like you can work around this problem by setting an 
environment variable on your dev system. See 
https://tox.readthedocs.org/en/latest/config.html#confval-passenv=SPACE-SEPARATED-GLOBNAMES

This reverts commit b9ca1d5344.

Change-Id: Ib051f0a9f1b4277548c9473bfaed5db7b1bb18e1
2016-01-15 19:39:47 +00:00
ting.wang dfb7d1faf4 Add debug testenv in tox
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.

the same in magnum:
https://review.openstack.org/#/c/266020/

Closes-Bug: #1534030
Change-Id: I63ea8086e269b4ecacb7f7e337f1adf2a869db94
2016-01-15 03:20:21 +00:00
Janonymous 619d1f0eb3 Put py34 first in the env order of tox
To solve the problem of "db type could
not be determined" on py34 we have to run first the py34 env to, then, run
py27. This patch puts py34 first on the tox.ini list of envs to avoid this
problem to happen.

Change-Id: Ie8d7eba53fd3e67d6090c6b54af765596c1497bc
Closes-bug: #1489059
2015-12-22 18:29:18 +05:30
shu-mutou 687ab3d4ba Drop py33 support
"Python 3.3 support is being dropped since OpenStack Liberty."
written in following URL.
https://wiki.openstack.org/wiki/Python3

And already the infra team and the oslo team are dropping py33
support from their projects.

Since we rely on oslo for a lot of our work, and depend on infra
for our CI, we should drop py33 support too.

Change-Id: I41d992d3e10d6cee8f215027092e5a1a5612d7be
Closes-Bug: #1526170
2015-12-15 16:12:09 +09:00
Manjeet Singh Bhatia 560898c646 use wild card for passing env variables
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.

for example *_proxy will get all variables like http_proxy,
https_proxy, no_proxy, any_proxy etc.

Change-Id: Id22d76be8ec165236e1f35f58a8e5617d0355281
2015-12-09 15:52:05 +00:00
shu-mutou a603e63f59 Remove py26 support
as of mitaka, the infra team won't have the resources available to
reasonably test py26, also the oslo team is dropping py26 support
from their libraries. sine we rely on oslo for a lot of our work,
and depend on infra for our CI, we should drop py26 support too.

Change-Id: I8c1e5765228382c9982883320568fe729d0c35f8
Closes-Bug: 1519510
2015-12-02 16:58:00 +09:00
wangqun 75c523cf98 Make bandit included in test-requirements.txt
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: Icd51df9baffb3e881a0f355423f56a1321b27ac3
2015-11-25 10:22:43 +00:00
OTSUKA, Yuanying 7703421ae4 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.

Change-Id: I77f144fc681eadcf8fd7fe735753090e3ebc6084
Closes-Bug: #1368661
2015-11-17 09:52:13 +09:00
James Page 5eb6725bde Add support for python >= 3.4
Python 3.4 changed some of the output from argparse and the
handling of default func and command behaviour; this patch
deals with both < and >= 3.4 behaviour.

Change-Id: I27983f7b06fc16aeedb98a4b36f7ff9a451706ec
Closes-Bug: 1496805
2015-09-18 09:45:01 +01:00
Zhenguo Niu c457cdaf22 Remove H803 rule
H803 rule was removed from hacking.

Change-Id: I4e1646e66a26a93bc2cad661a6941e23894dd55c
2015-07-17 23:06:58 +08:00
Motohiro OTSUKA b9ca1d5344 Pass environment variables of proxy to tox
When a development environment is under a proxy, tox is failed even if
environment variables of the proxy are set.
This patch fixes this problem.

See Also: https://review.openstack.org/#/c/191600

Change-Id: I0045cb2253a4d102196fdab277462891a886fe3a
Co-Authored-By: Yuiko Takada <takada-yuiko@mxn.nes.nec.co.jp>
Closes-Bug: #1465086
2015-06-15 12:54:41 +09:00
Kennan 59729557b9 Update bandit for latest usage
Check https://review.openstack.org/#/c/171772/ for details

Closes-Bug: #1442456
Change-Id: Ic2876bab2c22b8f0964a26c2588942d83e442f38
2015-04-10 11:22:01 +08:00
Steven Dake 7447d3b908 Add tox bandit support for python-magnumclient
Add bandit support for python-magnumclient executed via tox.  The
idea is to gate on bandit once we work out the kinks.  In the short
term, we will have an experiemtal job that can be run manually.  After
that it will be added as a non-voting check job.  Finally it will be
set as a voting check/gate.

Change-Id: I14d037cf611ea6efa9f8271e6e120cd11b764dc4
Partially-Implements: blueprint gate-bandit
2015-04-09 01:02:41 -07:00
Hongbin Lu 77084e6b84 Add support for updating a bay
Users can use these commands to add/remove/update bay attribute(s):
magnum bay-update <bay_id> replace <path=value>
magnum bay-update <bay_id> add <path=value>
magnum bay-update <bay_id> remove <path=value>

For example, this command updates the node_count attribute of a bay:
magnum bay-update 0aab40ba-3f48-4e6e-88a6-247be18b9711 replace node_count=1

Change-Id: If003beaca8e7e8bbdff2cf24d2810b0db9efdf41
Implements: blueprint update-node-count
2015-02-17 03:18:01 +00:00
Steven Dake 6d070c9db4 Boilerplate client for communicating with ReST API
Implements the boilerplate project setup.  After this commit, I'll
import this project into stackforge, and we can continue development
from there.

The rest API identified is that of the work Eric put together initially
including bays, pods, and container objects.
2014-11-18 14:55:41 -07:00