Fix tox-checkbuild CI job

[Changes in zuul configurations]
- playbooks/checkbuild/pre.yaml calls ensure-nodejs role, but the default
  nodejs version defined in ensure-nodejs role is still 6. nodejs6 repo
  is no longer available. This is the cause of the job failure.
  Let's specify nodejs_version used in horizon by default.
- Ensure to install tox globally in the system.
  tox -e checkbuild calls "tox" as the test commands,
  so it needs to be installed globally.
- Specify "python_version" so that zuul ensures to install a required
  version of python interpreter.

[Changes in cookiecutter template]
- hacking version in test-requirements.txt was too old.
  It is updated to use more recent version which horizon uses.
- Update python version to 3.9 in tox.ini.
- Install horizon and its dependencies separately.
  The constraints file contains horizon, so installing horizon along with
  the constraints file results in a version conflict error.

Change-Id: If4bae3fde1f29eeb1d4d43942acc21ff2ef19482
This commit is contained in:
Akihiro Motoki 2022-04-08 01:27:11 +09:00
parent 3b5d1a5de3
commit 8390e9d6d2
5 changed files with 16 additions and 10 deletions

View File

@ -5,6 +5,12 @@
post-run: playbooks/checkbuild/post.yaml
vars:
tox_envlist: checkbuild
ensure_global_symlinks: true
# node_version should match the default nodejs version
# used in horizon nodejs jobs.
node_version: 14
# It should match the python version in tox.ini in the template
python_version: 3.9
- project:
check:
jobs:

View File

@ -26,7 +26,7 @@ commands =
cookiecutter --no-input --output-dir {envdir} {toxinidir}
# To pass {postargs} for running `tox -edocs` in generated plugin,
# run `tox -- -edocs` in ui-cookiecutter.
tox --workdir {envdir}/cafe-ui/.tox -c {envdir}/cafe-ui/tox.ini {posargs}
tox -vv --workdir {envdir}/cafe-ui/.tox -c {envdir}/cafe-ui/tox.ini {posargs}
whitelist_externals =
git
rm

View File

@ -26,7 +26,7 @@
},
"dependencies": {},
"scripts": {
"postinstall": "if [ ! -d .tox ] || [ ! -d .tox/karma ]; then tox -ekarma --notest; python3 -m pip install -U -t ./.tox/karma/lib/`python3 -V|tr -d ' '|tr 'P' 'p'|cut -c -9`/site-packages/ -chttps://releases.openstack.org/constraints/upper/master ../horizon; fi",
"postinstall": "if [ ! -d .tox ] || [ ! -d .tox/karma ]; then tox -ekarma --notest; .tox/karma/bin/pip install -chttps://releases.openstack.org/constraints/upper/master -r../horizon/requirements.txt -r../horizon/test-requirements.txt; .tox/karma/bin/pip install ../horizon; fi",
"lint": "eslint --no-color {{ cookiecutter.module_name }}/static",
"lintq": "eslint --quiet {{ cookiecutter.module_name }}/static",
"test": "karma start {{ cookiecutter.module_name }}/karma.conf.js --single-run"

View File

@ -7,7 +7,7 @@
# be installed in a specific order.
#
# Hacking should appear first in case something else depends on pep8
hacking>=1.1.0,<1.2.0 # Apache-2.0
hacking>=3.0.1,<3.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
mock>=2.0.0 # BSD

View File

@ -1,5 +1,5 @@
[tox]
envlist = pep8,py36-local,py3-dj20-local,eslint,karma-local,docs-local,releasenotes
envlist = pep8,py39-local,py3-dj32-local,eslint,karma-local,docs-local,releasenotes
minversion = 2.3.2
skipsdist = True
@ -45,23 +45,23 @@ commands =
coverage xml --omit '.tox/cover/*' -o 'cover/coverage.xml'
coverage html --omit '.tox/cover/*' -d 'cover/htmlcov'
[testenv:py36-local]
basepython = python3.6
[testenv:py39-local]
basepython = python3.9
commands =
{[testenv:hz-local]commands}
{[testenv]commands}
[testenv:py3-dj22]
[testenv:py3-dj32]
basepython = python3
commands =
pip install django>=2.2,<3
pip install django>=3.2,<3.3
{[testenv]commands}
[testenv:py3-dj22-local]
[testenv:py3-dj32-local]
basepython = python3
commands =
{[testenv:hz-local]commands}
pip install django>=2.2,<3
pip install django>=3.2,<3.3
{[testenv]commands}
[testenv:eslint]