Since the requirements for documentation was split out, the default
venv target does not install these. Create the new dedicated target to
run documentation tools such as reno.
Change-Id: I43cc4149d8b97799703251e2e2e7b71020ee2948
With migration from ubuntu jammy to noble, python3.11 is not available
anymore. This makes the job to fail on pre-install step.
So let's use Python 3.12 which is available out of the box on Noble
after switch.
This also bumps pylint version, as older one does not work
anymore with Python 3.12. New pylint brings quite some new
rules with it. Some were disabled, some were fixed within this
patch.
Change-Id: I4ba288966c582910e8a822d4531e29c9c005e48f
Zuul deploy contains newer version of cirros (0.6.3) than our
tests expects (0.6.2).
Error Line too long for doc files. Added D001 to ignore.
Change-Id: I972f4b7db19fb3852c3b9fe055ec514e78655d52
tox now always recreates an env although the env is shared using envdir
options.
~~~
$ tox -e genpolicy
genpolicy: recreate env because env type changed from
{'name': 'genconfig', 'type': 'VirtualEnvRunner'} to
{'name': 'genpolicy', 'type': 'VirtualEnvRunner'}
~~~
According to the maintainer of tox, this functionality is not intended
to be supported.
https://github.com/tox-dev/tox/issues/425#issuecomment-1011944293
Change-Id: Ibda3bf5547b3530f854c667140699ecc8486ee85
Since bandit 1.7.7[1] we have to install the baseline extra to use
bandit-baseline.
[1] 22c75a8306
Change-Id: I3eda10d6dd5244c1075c576f24a5a024f7e50afd
Django 4.2 is our primary version in 2023.2 (Caracal),
so we need to start testing with Django 4.2.
Once all unit tests work, let's switch it to voting.
PYTHONWARNINGS in tox.ini is also simplified. We had three similar
variants of PYTHONWARNINGS in tox.ini. There is no need to use a
different value for py3 and py39 as we already use py39 by default.
PendingDeprecationWarning was added to hide Django deprecation
warnings, so I keep it now. On the other hand I think we should
handle Django deprecation warnings much earlier to sync Django
releases more promptly, so TODO comment is added.
Change-Id: I530be8fde637a912968b4ce7dbc94a4108dc50df
This is a patch to start work on re-writing the integration tests
using pytest syntax and several improvements, as proposed on the
upstream meeting, and summarized at https://etherpad.opendev.org/p/horizon-pytest
The new tests are to eventually replace the existing integration
tests. At the moment they don't run automatically, you have to explicitly run them using tox or pytest. When the new tests are complete, we will switch to them on the gate.
Change-Id: Iea38e4f9771ff3cae7ae8675863e9c488f3f6d8a
The validation of setenv in the recent tox like 4.2.8 seems more strict.
We need a space between a factor and envvar.
Note that we need to discuss the three variants of PYTHONWARNINGS
but this commit focuses on fixing the gate failure due to tox.ini.
Change-Id: I13be2d39850e77f15e5bbf67b0022b10b09e5c6f
OpenStack CI now uses tox4 by default.
- Drop "skipsdist = True".
If skipsdist is specified, horizon is not installed into tox env.
- Env vars specified in passenv should be one per line (or separated by
comma) in tox4.
Change-Id: I60d2db52e9aac580859de3ed17fde14f9fd262a2
This should save us some time and decrease the server load. If a single
test failed, we already know the patch is bad (or the tests need to be
rerun) so it makes no sense to execute the rest of the tests on the
gate.
Change-Id: Ic56d5e192487d444afd0cdf0bce5e1a691ba087c
Python runtimes for Zed are 3.8, 3.9 and optionally 3.10 [1][2],
so tox envs in tox.ini are updated accordingly.
Declare python_requires >=3.8 in setup.cfg
python_requires are declared in many projects during dropping
python 2.7 support. It is good to follow the convention and
it also clarifies our python interpreter requirement.
This commit also cleans up python2.7 related stuffs in setup.py.
Both are related to the supported versions of python,
so I made both changes in a single commit.
[1] https://governance.openstack.org/tc/reference/runtimes/zed.html
[2] b740b42fb1/zuul.d/project-templates.yaml (L542)
Change-Id: I4161816fd1fec19a3834cc7d994b3f761e1ab2ce
Closes-Bug: #1960887
Since tox 3.18.0, the whitelist_externals option has been deprecated in
favor of the new allow_list_externals option[1].
This change bumps the minversion of tox so that we can replace
the deprecated option.
[1] https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23
Change-Id: I1943ddbe8d63c577b5c8084a158af5bae4d1f9fc
Previously the path of the integration tests was specified explicitly
in tox.ini and we cannot run a specific test from tox.
{posargs} existed in the previous command line, but it can be used
only to specify extra options and we cannot change the test path,
so the whole integration tests are always run.
It can be solved by passing the integration test path as
the default value of {posargs}.
The most possible case where we would like to change the test command
is to run a specific set of tests instead of the whole tests,
so I believe this solution would work.
Change-Id: Ifa478a360a8af8b3d959de7ec632eedef484391d
This commit adds a non-voting unit test job with Django 3.2.
Jobs with Django 3.0 and 3.1 are dropped now.
They were introduced before Django 3.2 was released.
Django 3.0 reached EOL and Django 3.1 will reach EOL this December.
Django 3.2 is an LTS version so testing with Django 3.2 is enough.
Change-Id: Ic6ba0ea281b287b7f4762f92e2e81a6fd654da8f
One of suggestions discussed in the mailling thread [1] is to decouple
linters from test-requirements.txt. We uses specific versions of linters
(hacking, flake8, pylint and bandit) and they are potentially incompatbile
with other libraries in test-requirements.txt.
One example is bandit incompatibility detected by the new pip resolver.
This commit moves linters to tox.ini and introduces a new tox envdir
shared by linter related tox envs.
Note that we have a unit test for a local hacking rule so hacking needs
to be installed as part of the default dependencies. We can have it in
test-requirements.txt but I think it is better to have it in tox.ini
as hacking is a part of linters and other linter dependencies are
declared in tox.ini now.
[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-December/thread.html#19362
Change-Id: Ia41c5f665f01bdab187c9256b2319885998d12c3
This commit enables non-voting unit test jobs with Django 3.0/3.1.
PendingDeprecationWarning is added to PYTHONWARNINGS in tox.ini.
PendingDeprecationWarning in Django 3.0+ includes deprecation warnings
on what will be dropped in Django 4.0 and they cannot be addressed
as long as we use Django 2.2.
Change-Id: I44e511ddc1d93fc3e2b68393b88c5f2cd1360854
UPPER_CONSTRAINTS_FILE is old name and deprecated
This allows to use upper-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.
For more info. please refer [1].
[1] https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file
Change-Id: I1600df016b90383c77e179e186d8c58fa9868d92
`coverage run pytest` runs coverage against the tests in a file called
"pytest", whereas `coverage run -m pytest` uses pytest as the test
runner, which is what we really want here.
To avoid duplicated maitenance of pytest arguments,
unit_tests.sh is updated to handle the coverage run.
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I106cb5227ca8c4f0a6f9d81c37e745a6f304de45
"-j auto" enable parallel documentation build with multiple processes
and the number of processors is detected automatically.
This speeds up local documentation build a lot.
Change-Id: I7fab3a37a4a15b886d3456eebad86115a1a63f11
Python 3.8 is now our highest level supported python runtime.
This updates the default tox target environments to swap out
py37 for py38 to make sure local development testing is
covering this version.
This does not impact zuul jobs in any way, nor prevent local
tests against py37. It just changes the default if none is
explicitly provided.
Change-Id: I067ad1c53df481f578bad8ccc16c4c9d12a2d381
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Changes test invocation from `manage.py test` to `pytest`. Adds addtitional
test requirements like pytest, pytest-django, pytest-html. Adds
`pytest.mark` alongside django's test `tag`. Adds posibility to export test
results into xml and html formats.
Depends-On: https://review.opendev.org/#/c/712315/
Related-Bug: #1866666
Co-Authored-By: Ivan Kolodyazhny <e0ne@e0ne.info>
Change-Id: Idb6e63cd23ca2ba8ca56f36eb8b63069bd211944
PYTHONHASHSEED for integration tests was added in 2015 to run tests in a
same order each time. Now we don't need this workaround because
integration tests work well in any order they are executed.
Change-Id: Ide019baaf8786da14cc9edcc46b40ab5fabf3ef5
Configurations of the integration tests are maintained both
in horizon.conf and in-code configuration. It is redundant.
Configurations of the integration tests are defined by oslo.config.
We can use default values from them and generate a sample config file
using oslo-config-generator.
This commit drops horizon.conf and generates the sample config.
We no longer have horizon.conf, so the logic to load the config files
is updated accordingly.
Also makes the usage of single and double quotes in config.py consistent.
Change-Id: Id16c9fd4114316ade63c74097e486623d0c5be9f
We already have a template 'horizon-non-primary-django-jobs'
to test horizon and plugins with non-primary django versions,
but we still need to update tox.ini in all horizon plugins
whenever we change Django versions used.
This commit prepares per-Django environment in the zuul job.
Per-Django tox environments like py3-{dj111,dj20,dj22} are
no longer needed. It would be a big merit that we will no longer
need to update tox.ini in all horizon plugins.
The downside is that we do not provide a convenient way to
test it locally, but I think it can be covered in the document.
Change-Id: I726b19130ee9e7d06eb33231071c2673cfd3a49f
Compiling translation messages on every run of runserver makes it very
slow and inconvenient for development. Editing of the translations is
done rarely, and compilemessages can be run manually when it does
happen.
I'm also adding -v 0 to all the manage commands, to make it output
less garbage to the screen, making it a little easier to find actual
errors during development.
Change-Id: I95db4505c3a9cd5b2ecc3e6ad6a30d438a4447b9
Previously doc8 is run as part of pep8 tox env. This leads to some tricky
'deps' in pep8 which installs the docs dependencies. This can be fixed by
moving doc8 to the docs related tox envs (docs and releasenotes).
This also helps developers using devstack avoid hitting an error in
"manage.py compilemessages" in stack.sh. The error is caused by sphinx
installed under .tox directory (as compilemessages tries to compile all
message catalogs even under dot directories like .tox).
Developers sometimes change the horizon code under /opt/stack/horizon
and it is not surprising to run "tox -e pep8".
(I think it is more common compared to a chance to run "tox -e docs".)
Thus I believe it is reasonable to move doc8 to the docs env.
Change-Id: I6345ebbcd24afc358555e9be4b2ca700c4b33861
- Use 'ignore_basepython_conflict' and set 'basepython' globally,
avoiding the need to do it in each environment
- Set 'commands' in the top-level 'testenv' and just reference this
where needed
- Remove unneeded 'setenv'
Change-Id: Ib2ac6279abf5cf3fa39cb1b72622e41c502429b5
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Use the real python executable as shebang
Use exec instead of execfile if using python 3
Change-Id: I8acea40851c7e9dc248751be967859b2b9430af7
Closes-Bug: #1836580
By default, Horizon doesn't compile localized messages in tox
environment. It leads to silent fail of language change with 'Success'
message. Proposed patch includes compilation of messages to tox runserver
command
Change-Id: I149a622a81a17e9d951c68829349fc70fbb8ed2a