Add openstack-common and test infrastructure.
Fix pep8 errors (project is pep8 clean now).
Update setup.py to use openstack-common style dependencies.
Remove the unused novaclient dependency.
Change the keystoneclient dependency to a git URL.
Add test-requires, and move some pip-requires dependencies
into it.
Remove the test_utils unit test which wasn't testing anything
that is actually present in the project.
Add the test_authors unit test.
Use tox for running tests locally.
See: http://wiki.openstack.org/ProjectTestingInterface
Tox can manage virtualenvs, and is currently doing so for running
tests in Jenkins. It's just as, or more, useful for running tests
locally, so this starts the migration from the run_tests system to
tox. The goal is to reduce duplicate testing infrastructure, and
get what's running locally on developer workstations as close to
what is run by Jenkins as possible.
Run_tests.sh will now call tox to facilitate the transition for
developers used to typing "run_tests.sh".
Developers will need tox installed on their workstations. It can
be installed from PyPI with "pip install tox". run_tests.sh outputs
those instructions if tox is not present.
New facilities are available using tox directly, including:
tox -e py26 # run tests under python 2.6
tox -e py27 # run tests under python 2.7
tox -e pep8 # run pep8 tests
tox # run all of the above
tox -e venv foo # run the command "foo" inside a virtualenv
The OpenStack nose plugin is used when running tox from the
command line, so the enhanced, colorized output is visible to
developers running the test suite locally. However, when Jenkins
runs tox, xunit output will be used instead, which is natively
understood by jenkins and much more readable in that context.
Change-Id: Ib627be3b37b5a09d3795006d412ddcc35f8c6c1e
2012-04-28 22:21:53 +00:00
|
|
|
[tox]
|
2023-05-10 10:57:25 +01:00
|
|
|
minversion = 4.3.0
|
2022-12-22 20:45:20 +01:00
|
|
|
envlist = py3,pep8
|
Add openstack-common and test infrastructure.
Fix pep8 errors (project is pep8 clean now).
Update setup.py to use openstack-common style dependencies.
Remove the unused novaclient dependency.
Change the keystoneclient dependency to a git URL.
Add test-requires, and move some pip-requires dependencies
into it.
Remove the test_utils unit test which wasn't testing anything
that is actually present in the project.
Add the test_authors unit test.
Use tox for running tests locally.
See: http://wiki.openstack.org/ProjectTestingInterface
Tox can manage virtualenvs, and is currently doing so for running
tests in Jenkins. It's just as, or more, useful for running tests
locally, so this starts the migration from the run_tests system to
tox. The goal is to reduce duplicate testing infrastructure, and
get what's running locally on developer workstations as close to
what is run by Jenkins as possible.
Run_tests.sh will now call tox to facilitate the transition for
developers used to typing "run_tests.sh".
Developers will need tox installed on their workstations. It can
be installed from PyPI with "pip install tox". run_tests.sh outputs
those instructions if tox is not present.
New facilities are available using tox directly, including:
tox -e py26 # run tests under python 2.6
tox -e py27 # run tests under python 2.7
tox -e pep8 # run pep8 tests
tox # run all of the above
tox -e venv foo # run the command "foo" inside a virtualenv
The OpenStack nose plugin is used when running tox from the
command line, so the enhanced, colorized output is visible to
developers running the test suite locally. However, when Jenkins
runs tox, xunit output will be used instead, which is natively
understood by jenkins and much more readable in that context.
Change-Id: Ib627be3b37b5a09d3795006d412ddcc35f8c6c1e
2012-04-28 22:21:53 +00:00
|
|
|
|
|
|
|
[testenv]
|
2023-05-10 10:57:25 +01:00
|
|
|
usedevelop = true
|
2022-12-22 20:45:20 +01:00
|
|
|
setenv =
|
|
|
|
OS_STDOUT_CAPTURE=1
|
|
|
|
OS_STDERR_CAPTURE=1
|
|
|
|
OS_TEST_TIMEOUT=60
|
2017-12-01 10:22:39 -06:00
|
|
|
deps =
|
2022-12-22 20:45:20 +01:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
-r{toxinidir}/requirements.txt
|
2023-05-10 10:57:25 +01:00
|
|
|
commands =
|
|
|
|
stestr run {posargs}
|
Add openstack-common and test infrastructure.
Fix pep8 errors (project is pep8 clean now).
Update setup.py to use openstack-common style dependencies.
Remove the unused novaclient dependency.
Change the keystoneclient dependency to a git URL.
Add test-requires, and move some pip-requires dependencies
into it.
Remove the test_utils unit test which wasn't testing anything
that is actually present in the project.
Add the test_authors unit test.
Use tox for running tests locally.
See: http://wiki.openstack.org/ProjectTestingInterface
Tox can manage virtualenvs, and is currently doing so for running
tests in Jenkins. It's just as, or more, useful for running tests
locally, so this starts the migration from the run_tests system to
tox. The goal is to reduce duplicate testing infrastructure, and
get what's running locally on developer workstations as close to
what is run by Jenkins as possible.
Run_tests.sh will now call tox to facilitate the transition for
developers used to typing "run_tests.sh".
Developers will need tox installed on their workstations. It can
be installed from PyPI with "pip install tox". run_tests.sh outputs
those instructions if tox is not present.
New facilities are available using tox directly, including:
tox -e py26 # run tests under python 2.6
tox -e py27 # run tests under python 2.7
tox -e pep8 # run pep8 tests
tox # run all of the above
tox -e venv foo # run the command "foo" inside a virtualenv
The OpenStack nose plugin is used when running tox from the
command line, so the enhanced, colorized output is visible to
developers running the test suite locally. However, when Jenkins
runs tox, xunit output will be used instead, which is natively
understood by jenkins and much more readable in that context.
Change-Id: Ib627be3b37b5a09d3795006d412ddcc35f8c6c1e
2012-04-28 22:21:53 +00:00
|
|
|
|
|
|
|
[testenv:pep8]
|
Fix lower-constraints job
pip 20.3 finally includes a proper dependency resolver. Its use is
causing the following error messages on the lower-constraints job:
ERROR: Cannot install ... because these package versions have
conflicting dependencies.
The conflict is caused by:
bandit 1.1.0 depends on PyYAML>=3.1.0
cliff 3.4.0 depends on PyYAML>=3.12
openstacksdk 0.52.0 depends on PyYAML>=3.13
Bump our lower constraint for PyYAML to resolve this issue. With that
resolved, we see a new issue:
ERROR: Could not find a version that satisfies the requirement
cryptography>=2.7 (from openstacksdk)
ERROR: No matching distribution found for cryptography>=2.7
This is less self-explanatory but looking at the lower-constraints for
openstacksdk 0.52.0 shows a dependency on cryptography 2.7 [1], meaning
we need to bump this also.
Next up, flake8-import-order seems to cause the dependency resolver to
go nuts, eventually ending with the following error message in a Python
3.6 environment:
Using cached enum34-1.1.2.zip (49 kB)
ERROR: Command errored out with exit status 1:
command: ...
cwd: ...
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File ".../lib/python3.6/site-packages/setuptools/__init__.py", line 7, in <module>
import setuptools.distutils_patch # noqa: F401
File ".../lib/python3.6/site-packages/setuptools/distutils_patch.py", line 9, in <module>
import re
File "/usr/lib64/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
----------------------------------------
A quick Google suggests this is because the enum34 package is not
complete [2]. We shouldn't even be using it since our base virtualenv
should at least use Python 3.6, but I guess some dependency doesn't
properly restrict the dependency to <= Python 3.4. This is moved from
'test-requirements.txt' to 'tox.ini' since we don't need to use our
constraints machinery for linters.
Finally, the versions of bandit and hacking that pip is bringing in both
requires in a newer version of babel, which in turn requires a new
version of pytz.
Collecting hacking>=2.0.0
...
ERROR: Cannot install oslo.i18n because these package versions have
conflicting dependencies.
The conflict is caused by:
babel 2.9.0 depends on pytz>=2015.7
babel 2.8.1 depends on pytz>=2015.7
babel 2.8.0 depends on pytz>=2015.7
babel 2.7.0 depends on pytz>=2015.7
Seeing as we shouldn't be tracking bandit in
lower-constraints, I'm not sure why we're want to bump these
dependencies for just that. As above, we move these dependencies out of
'test-requirements' and into 'tox.ini' since we can do that for linters.
[1] https://opendev.org/openstack/openstacksdk/src/tag/0.52.0/requirements.txt#L19
[2] https://github.com/iterative/dvc/issues/1995#issuecomment-491889669
Change-Id: I8ec738fbcabc8d8553db79a876e5592576cd18fa
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-12-08 10:20:19 +00:00
|
|
|
deps =
|
2023-05-08 11:12:16 +01:00
|
|
|
pre-commit
|
2016-04-28 11:38:38 -04:00
|
|
|
commands =
|
2023-05-08 11:12:16 +01:00
|
|
|
pre-commit run --all-files --show-diff-on-failure
|
2016-04-28 11:38:38 -04:00
|
|
|
|
|
|
|
[testenv:bandit]
|
|
|
|
# This command runs the bandit security linter against the openstackclient
|
|
|
|
# codebase minus the tests directory. Some tests are being excluded to
|
|
|
|
# reduce the number of positives before a team inspection, and to ensure a
|
|
|
|
# passing gate job for initial addition. The excluded tests are:
|
|
|
|
# B105-B107: hardcoded password checks - likely to generate false positives
|
|
|
|
# in a gate environment
|
|
|
|
# B401: import subprocess - not necessarily a security issue; this plugin is
|
|
|
|
# mainly used for penetration testing workflow
|
|
|
|
# B603,B606: process without shell - not necessarily a security issue; this
|
|
|
|
# plugin is mainly used for penetration testing workflow
|
|
|
|
# B607: start process with a partial path - this should be a project level
|
|
|
|
# decision
|
|
|
|
# NOTE(elmiko): The following tests are being excluded specifically for
|
|
|
|
# python-openstackclient, they are being excluded to ensure that voting jobs
|
|
|
|
# in the project and in bandit integration tests continue to pass. These
|
|
|
|
# tests have generated issue within the project and should be investigated
|
|
|
|
# by the project.
|
|
|
|
# B110: try, except, pass detected - possible security issue; this should be
|
|
|
|
# investigated by the project for possible exploitation
|
|
|
|
# B605: process with a shell - possible security issue; this should be
|
|
|
|
# investigated by the project for possible exploitation
|
|
|
|
# B101: use of assert - this code will be removed when compiling to optimized
|
|
|
|
# byte code
|
|
|
|
commands =
|
|
|
|
bandit -r openstackclient -x tests -s B105,B106,B107,B401,B404,B603,B606,B607,B110,B605,B101
|
Add openstack-common and test infrastructure.
Fix pep8 errors (project is pep8 clean now).
Update setup.py to use openstack-common style dependencies.
Remove the unused novaclient dependency.
Change the keystoneclient dependency to a git URL.
Add test-requires, and move some pip-requires dependencies
into it.
Remove the test_utils unit test which wasn't testing anything
that is actually present in the project.
Add the test_authors unit test.
Use tox for running tests locally.
See: http://wiki.openstack.org/ProjectTestingInterface
Tox can manage virtualenvs, and is currently doing so for running
tests in Jenkins. It's just as, or more, useful for running tests
locally, so this starts the migration from the run_tests system to
tox. The goal is to reduce duplicate testing infrastructure, and
get what's running locally on developer workstations as close to
what is run by Jenkins as possible.
Run_tests.sh will now call tox to facilitate the transition for
developers used to typing "run_tests.sh".
Developers will need tox installed on their workstations. It can
be installed from PyPI with "pip install tox". run_tests.sh outputs
those instructions if tox is not present.
New facilities are available using tox directly, including:
tox -e py26 # run tests under python 2.6
tox -e py27 # run tests under python 2.7
tox -e pep8 # run pep8 tests
tox # run all of the above
tox -e venv foo # run the command "foo" inside a virtualenv
The OpenStack nose plugin is used when running tox from the
command line, so the enhanced, colorized output is visible to
developers running the test suite locally. However, when Jenkins
runs tox, xunit output will be used instead, which is natively
understood by jenkins and much more readable in that context.
Change-Id: Ib627be3b37b5a09d3795006d412ddcc35f8c6c1e
2012-04-28 22:21:53 +00:00
|
|
|
|
2017-10-27 12:40:16 -05:00
|
|
|
[testenv:unit-tips]
|
|
|
|
commands =
|
2019-11-15 10:06:35 +01:00
|
|
|
python -m pip install -q -U -e "git+file://{toxinidir}/../cliff#egg=cliff"
|
|
|
|
python -m pip install -q -U -e "git+file://{toxinidir}/../keystoneauth#egg=keystoneauth"
|
|
|
|
python -m pip install -q -U -e "git+file://{toxinidir}/../osc-lib#egg=osc_lib"
|
|
|
|
pythom -m pip install -q -e "git+file://{toxinidir}/../openstacksdk#egg=openstacksdk"
|
|
|
|
python -m pip freeze
|
2017-12-27 16:16:23 +09:00
|
|
|
stestr run {posargs}
|
2017-10-27 12:40:16 -05:00
|
|
|
|
2014-09-19 02:42:55 +00:00
|
|
|
[testenv:functional]
|
2023-05-08 11:12:16 +01:00
|
|
|
setenv =
|
2022-12-22 20:45:20 +01:00
|
|
|
OS_TEST_PATH=./openstackclient/tests/functional
|
2023-05-08 11:12:16 +01:00
|
|
|
passenv =
|
2022-12-22 20:45:20 +01:00
|
|
|
OS_*
|
2017-10-19 15:48:12 -05:00
|
|
|
commands =
|
2019-01-08 15:39:58 +00:00
|
|
|
stestr run {posargs}
|
2014-09-19 02:42:55 +00:00
|
|
|
|
2017-01-11 11:21:21 -05:00
|
|
|
[testenv:functional-tips]
|
2022-12-22 20:45:20 +01:00
|
|
|
setenv =
|
|
|
|
OS_TEST_PATH=./openstackclient/tests/functional
|
|
|
|
passenv =
|
|
|
|
OS_*
|
2017-01-11 11:21:21 -05:00
|
|
|
commands =
|
2019-11-15 10:06:35 +01:00
|
|
|
python -m pip install -q -U -e "git+file://{toxinidir}/../cliff#egg=cliff"
|
2021-05-11 11:22:59 +00:00
|
|
|
python -m pip install -q -U -e "git+file://{toxinidir}/../keystoneauth#egg=keystoneauth1"
|
2019-11-15 10:06:35 +01:00
|
|
|
python -m pip install -q -U -e "git+file://{toxinidir}/../osc-lib#egg=osc_lib"
|
|
|
|
python -m pip install -q -U -e "git+file://{toxinidir}/../openstacksdk#egg=openstacksdk"
|
|
|
|
python -m pip freeze
|
2019-01-08 15:39:58 +00:00
|
|
|
stestr run {posargs}
|
2017-01-11 11:21:21 -05:00
|
|
|
|
Add openstack-common and test infrastructure.
Fix pep8 errors (project is pep8 clean now).
Update setup.py to use openstack-common style dependencies.
Remove the unused novaclient dependency.
Change the keystoneclient dependency to a git URL.
Add test-requires, and move some pip-requires dependencies
into it.
Remove the test_utils unit test which wasn't testing anything
that is actually present in the project.
Add the test_authors unit test.
Use tox for running tests locally.
See: http://wiki.openstack.org/ProjectTestingInterface
Tox can manage virtualenvs, and is currently doing so for running
tests in Jenkins. It's just as, or more, useful for running tests
locally, so this starts the migration from the run_tests system to
tox. The goal is to reduce duplicate testing infrastructure, and
get what's running locally on developer workstations as close to
what is run by Jenkins as possible.
Run_tests.sh will now call tox to facilitate the transition for
developers used to typing "run_tests.sh".
Developers will need tox installed on their workstations. It can
be installed from PyPI with "pip install tox". run_tests.sh outputs
those instructions if tox is not present.
New facilities are available using tox directly, including:
tox -e py26 # run tests under python 2.6
tox -e py27 # run tests under python 2.7
tox -e pep8 # run pep8 tests
tox # run all of the above
tox -e venv foo # run the command "foo" inside a virtualenv
The OpenStack nose plugin is used when running tox from the
command line, so the enhanced, colorized output is visible to
developers running the test suite locally. However, when Jenkins
runs tox, xunit output will be used instead, which is natively
understood by jenkins and much more readable in that context.
Change-Id: Ib627be3b37b5a09d3795006d412ddcc35f8c6c1e
2012-04-28 22:21:53 +00:00
|
|
|
[testenv:venv]
|
2018-01-27 20:43:51 -05:00
|
|
|
deps =
|
2023-05-10 10:57:25 +01:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
|
|
|
commands =
|
|
|
|
{posargs}
|
Add openstack-common and test infrastructure.
Fix pep8 errors (project is pep8 clean now).
Update setup.py to use openstack-common style dependencies.
Remove the unused novaclient dependency.
Change the keystoneclient dependency to a git URL.
Add test-requires, and move some pip-requires dependencies
into it.
Remove the test_utils unit test which wasn't testing anything
that is actually present in the project.
Add the test_authors unit test.
Use tox for running tests locally.
See: http://wiki.openstack.org/ProjectTestingInterface
Tox can manage virtualenvs, and is currently doing so for running
tests in Jenkins. It's just as, or more, useful for running tests
locally, so this starts the migration from the run_tests system to
tox. The goal is to reduce duplicate testing infrastructure, and
get what's running locally on developer workstations as close to
what is run by Jenkins as possible.
Run_tests.sh will now call tox to facilitate the transition for
developers used to typing "run_tests.sh".
Developers will need tox installed on their workstations. It can
be installed from PyPI with "pip install tox". run_tests.sh outputs
those instructions if tox is not present.
New facilities are available using tox directly, including:
tox -e py26 # run tests under python 2.6
tox -e py27 # run tests under python 2.7
tox -e pep8 # run pep8 tests
tox # run all of the above
tox -e venv foo # run the command "foo" inside a virtualenv
The OpenStack nose plugin is used when running tox from the
command line, so the enhanced, colorized output is visible to
developers running the test suite locally. However, when Jenkins
runs tox, xunit output will be used instead, which is natively
understood by jenkins and much more readable in that context.
Change-Id: Ib627be3b37b5a09d3795006d412ddcc35f8c6c1e
2012-04-28 22:21:53 +00:00
|
|
|
|
|
|
|
[testenv:cover]
|
2017-12-27 16:16:23 +09:00
|
|
|
setenv =
|
|
|
|
VIRTUAL_ENV={envdir}
|
|
|
|
PYTHON=coverage run --source openstackclient --parallel-mode
|
2016-02-24 10:44:06 +08:00
|
|
|
commands =
|
2017-12-27 16:16:23 +09:00
|
|
|
stestr -q run {posargs}
|
|
|
|
coverage combine
|
|
|
|
coverage html -d cover
|
|
|
|
coverage xml -o cover/coverage.xml
|
Add openstack-common and test infrastructure.
Fix pep8 errors (project is pep8 clean now).
Update setup.py to use openstack-common style dependencies.
Remove the unused novaclient dependency.
Change the keystoneclient dependency to a git URL.
Add test-requires, and move some pip-requires dependencies
into it.
Remove the test_utils unit test which wasn't testing anything
that is actually present in the project.
Add the test_authors unit test.
Use tox for running tests locally.
See: http://wiki.openstack.org/ProjectTestingInterface
Tox can manage virtualenvs, and is currently doing so for running
tests in Jenkins. It's just as, or more, useful for running tests
locally, so this starts the migration from the run_tests system to
tox. The goal is to reduce duplicate testing infrastructure, and
get what's running locally on developer workstations as close to
what is run by Jenkins as possible.
Run_tests.sh will now call tox to facilitate the transition for
developers used to typing "run_tests.sh".
Developers will need tox installed on their workstations. It can
be installed from PyPI with "pip install tox". run_tests.sh outputs
those instructions if tox is not present.
New facilities are available using tox directly, including:
tox -e py26 # run tests under python 2.6
tox -e py27 # run tests under python 2.7
tox -e pep8 # run pep8 tests
tox # run all of the above
tox -e venv foo # run the command "foo" inside a virtualenv
The OpenStack nose plugin is used when running tox from the
command line, so the enhanced, colorized output is visible to
developers running the test suite locally. However, when Jenkins
runs tox, xunit output will be used instead, which is natively
understood by jenkins and much more readable in that context.
Change-Id: Ib627be3b37b5a09d3795006d412ddcc35f8c6c1e
2012-04-28 22:21:53 +00:00
|
|
|
|
2014-10-21 18:00:13 -04:00
|
|
|
[testenv:debug]
|
2022-12-22 20:45:20 +01:00
|
|
|
passenv =
|
|
|
|
OS_*
|
2017-01-20 17:48:11 +08:00
|
|
|
commands =
|
|
|
|
oslo_debug_helper -t openstackclient/tests {posargs}
|
2014-10-21 18:00:13 -04:00
|
|
|
|
2014-06-17 23:24:55 -04:00
|
|
|
[testenv:docs]
|
2017-12-28 23:07:09 +08:00
|
|
|
deps =
|
2023-05-10 10:57:25 +01:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2018-04-03 17:29:59 +01:00
|
|
|
commands =
|
2023-05-10 10:57:25 +01:00
|
|
|
sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html
|
|
|
|
sphinx-build -a -E -W -d doc/build/doctrees -b man doc/source doc/build/man
|
|
|
|
# Validate redirects (must be done after the docs build
|
|
|
|
whereto doc/build/html/.htaccess doc/test/redirect-tests.txt
|
2014-06-17 23:24:55 -04:00
|
|
|
|
2015-12-02 10:04:39 -06:00
|
|
|
[testenv:releasenotes]
|
2017-12-28 23:07:09 +08:00
|
|
|
deps =
|
2023-05-10 10:57:25 +01:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2017-12-28 23:07:09 +08:00
|
|
|
commands =
|
2023-05-10 10:57:25 +01:00
|
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
2015-12-02 10:04:39 -06:00
|
|
|
|
2013-05-14 08:29:16 -07:00
|
|
|
[flake8]
|
2023-05-10 10:57:25 +01:00
|
|
|
show-source = true
|
2021-10-13 12:14:30 +01:00
|
|
|
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,releasenotes
|
2023-05-08 11:03:05 +01:00
|
|
|
# E203 Black will put spaces after colons in list comprehensions
|
2023-05-31 17:39:59 +01:00
|
|
|
# E501 Black takes care of line length for us
|
2023-05-08 11:03:05 +01:00
|
|
|
# H301 Black will put commas after imports that can't fit on one line
|
2022-09-22 18:09:08 +01:00
|
|
|
# W503 and W504 are disabled since they're not very useful
|
2023-05-31 17:39:59 +01:00
|
|
|
ignore = E203,E501,H301,W503,W504
|
2017-07-15 16:58:08 +00:00
|
|
|
import-order-style = pep8
|
2017-08-22 21:38:07 +00:00
|
|
|
application_import_names = openstackclient
|