Fix tox jobs and remove tox_helper.sh
Horizon plugins needs horizon on master branch for our master development and test. Recent changes in CI infra and horizon force to change horizon installation, and added tox_helper.sh as trivial fix. Now, reasonable fix found for horizon plugins, so this patch fixes them. Also, use python3.5 for js jobs. Change-Id: Ibcaf177db21f96e60ee2b222ddd24bc61c3ee9e4
This commit is contained in:
parent
8bdee46fa4
commit
0a01169189
28
.zuul.yaml
28
.zuul.yaml
@ -1,7 +1,31 @@
|
|||||||
- project:
|
- project:
|
||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
- openstack-tox-lower-constraints
|
- nodejs-npm-run-lint:
|
||||||
|
vars:
|
||||||
|
node_version: 4
|
||||||
|
required-projects:
|
||||||
|
- openstack/horizon
|
||||||
|
- nodejs-npm-run-test:
|
||||||
|
vars:
|
||||||
|
node_version: 4
|
||||||
|
required-projects:
|
||||||
|
- openstack/horizon
|
||||||
|
- openstack-tox-lower-constraints:
|
||||||
|
required-projects:
|
||||||
|
- openstack/horizon
|
||||||
gate:
|
gate:
|
||||||
jobs:
|
jobs:
|
||||||
- openstack-tox-lower-constraints
|
- nodejs-npm-run-lint:
|
||||||
|
vars:
|
||||||
|
node_version: 4
|
||||||
|
required-projects:
|
||||||
|
- openstack/horizon
|
||||||
|
- nodejs-npm-run-test:
|
||||||
|
vars:
|
||||||
|
node_version: 4
|
||||||
|
required-projects:
|
||||||
|
- openstack/horizon
|
||||||
|
- openstack-tox-lower-constraints:
|
||||||
|
required-projects:
|
||||||
|
- openstack/horizon
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
"phantomjs-prebuilt": "2.1.x"
|
"phantomjs-prebuilt": "2.1.x"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "if [ ! -d .tox ] || [ ! -d .tox/karma ]; then tox -ekarma --notest; git clone https://git.openstack.org/openstack/horizon.git .tox/karma/src/horizon; pip install -U -t .tox/karma/lib/python2.7/site-packages/ .tox/karma/src/horizon; fi",
|
"postinstall": "if [ ! -d .tox ] || [ ! -d .tox/karma ]; then tox -ekarma --notest; pip install -U -t ./.tox/karma/lib/python3.5/site-packages/ ../horizon; fi",
|
||||||
"test": "karma start zun_ui/karma.conf.js --single-run",
|
"test": "karma start zun_ui/karma.conf.js --single-run",
|
||||||
"lint": "eslint --no-color zun_ui/static",
|
"lint": "eslint --no-color zun_ui/static",
|
||||||
"lintq": "eslint --quiet zun_ui/static"
|
"lintq": "eslint --quiet zun_ui/static"
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
ENVNAME=$1
|
|
||||||
BASEPYTHON=$2
|
|
||||||
COMMAND=$3
|
|
||||||
|
|
||||||
if [ ${COMMAND} = "pre" ]; then
|
|
||||||
# crean-up
|
|
||||||
rm -fr .tox/${ENVNAME}-log/
|
|
||||||
# install horizon from git
|
|
||||||
rm -fr .tox/${ENVNAME}/src/
|
|
||||||
git clone https://git.openstack.org/openstack/horizon.git .tox/${ENVNAME}/src/horizon
|
|
||||||
pip install -U -t .tox/${ENVNAME}/lib/${BASEPYTHON}/site-packages/ .tox/${ENVNAME}/src/horizon
|
|
||||||
elif [ ${COMMAND} = "post" ]; then
|
|
||||||
# crean-up
|
|
||||||
rm -fr .tox/${ENVNAME}/src/
|
|
||||||
mv .tox/${ENVNAME}/log/ .tox/${ENVNAME}-log/
|
|
||||||
rm -fr .tox/${ENVNAME}/
|
|
||||||
fi
|
|
||||||
|
|
95
tox.ini
95
tox.ini
@ -1,5 +1,5 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = pep8,py35,py35dj20,py27,eslint,karma,docs,releasenotes
|
envlist = pep8,py27-local,py35-local,py35dj20-local,eslint,karma-local,docs-local,releasenotes,lower-constraints-local
|
||||||
minversion = 2.3.2
|
minversion = 2.3.2
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
|
|
||||||
@ -19,10 +19,17 @@ deps =
|
|||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
commands = python manage.py test {posargs} --settings=zun_ui.test.settings
|
commands = python manage.py test {posargs} --settings=zun_ui.test.settings
|
||||||
|
|
||||||
|
# For installation of horizon on local
|
||||||
|
# NOTICE: this tox.ini requires horizon repository cloned in sibling directory.
|
||||||
|
[testenv:hz-local]
|
||||||
|
commands =
|
||||||
|
pip install -e ../horizon
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
|
basepython = python3.5
|
||||||
commands = flake8 {posargs}
|
commands = flake8 {posargs}
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
@ -32,68 +39,81 @@ max-complexity = 20
|
|||||||
[testenv:cover]
|
[testenv:cover]
|
||||||
commands = python setup.py test --coverage --testr-args='{posargs}'
|
commands = python setup.py test --coverage --testr-args='{posargs}'
|
||||||
|
|
||||||
|
# NOTE(shu-mutow): On CI infra, horizon will be installed
|
||||||
|
# according to job setting. but on local, we need to install
|
||||||
|
# horizon from master branch.
|
||||||
[testenv:py27]
|
[testenv:py27]
|
||||||
commands =
|
basepython = python2.7
|
||||||
# Clean-up env and install horizon from git
|
|
||||||
{toxinidir}/tools/tox_helper.sh {envname} {basepython} pre
|
|
||||||
# Run test
|
|
||||||
python manage.py test {posargs}
|
|
||||||
# Clean-up env except log
|
|
||||||
{toxinidir}/tools/tox_helper.sh {envname} {basepython} post
|
|
||||||
|
|
||||||
[testenv:py35]
|
[testenv:py27-local]
|
||||||
|
basepython = python2.7
|
||||||
|
commands =
|
||||||
|
{[testenv:hz-local]commands}
|
||||||
|
{[testenv]commands}
|
||||||
|
|
||||||
|
[testenv:py35-local]
|
||||||
basepython = python3.5
|
basepython = python3.5
|
||||||
commands =
|
commands =
|
||||||
# Clean-up env and install horizon from git
|
{[testenv:hz-local]commands}
|
||||||
{toxinidir}/tools/tox_helper.sh {envname} {basepython} pre
|
{[testenv]commands}
|
||||||
# Run test
|
|
||||||
python manage.py test {posargs}
|
|
||||||
# Clean-up env except log
|
|
||||||
{toxinidir}/tools/tox_helper.sh {envname} {basepython} post
|
|
||||||
|
|
||||||
[testenv:py35dj20]
|
[testenv:py35dj20]
|
||||||
basepython = python3.5
|
basepython = python3.5
|
||||||
commands =
|
commands =
|
||||||
# Clean-up env and install horizon from git
|
{[testenv:hz-local]commands}
|
||||||
{toxinidir}/tools/tox_helper.sh {envname} {basepython} pre
|
{[testenv]commands}
|
||||||
# Run test
|
|
||||||
pip install django>=2.0,<2.1
|
[testenv:py35dj20-local]
|
||||||
python manage.py test {posargs}
|
basepython = python3.5
|
||||||
# Clean-up env except log
|
commands =
|
||||||
{toxinidir}/tools/tox_helper.sh {envname} {basepython} post
|
{[testenv:hz-local]commands}
|
||||||
|
pip install -U django>=2.0,<2.1
|
||||||
|
{[testenv]commands}
|
||||||
|
|
||||||
[testenv:eslint]
|
[testenv:eslint]
|
||||||
|
basepython = python3.5
|
||||||
whitelist_externals =
|
whitelist_externals =
|
||||||
npm
|
npm
|
||||||
commands =
|
commands =
|
||||||
# Clean-up env and install horizon from git
|
|
||||||
{toxinidir}/tools/tox_helper.sh {envname} {basepython} pre
|
|
||||||
# Run test
|
|
||||||
npm install
|
npm install
|
||||||
npm run lint
|
npm run lint
|
||||||
# Clean-up env except log
|
|
||||||
{toxinidir}/tools/tox_helper.sh {envname} {basepython} post
|
|
||||||
|
|
||||||
|
# NOTE(shu-mutow): The "postinstall" script on package.json will install horizon
|
||||||
|
# from master branch into py35 environment for testing javascripts.
|
||||||
|
# Horizon from master is needed to be cloned into ../horizon on both local and CI.
|
||||||
[testenv:karma]
|
[testenv:karma]
|
||||||
|
basepython = python3.5
|
||||||
whitelist_externals =
|
whitelist_externals =
|
||||||
npm
|
{[testenv:eslint]whitelist_externals}
|
||||||
commands =
|
commands =
|
||||||
# Clean-up env and install horizon from git
|
|
||||||
{toxinidir}/tools/tox_helper.sh {envname} {basepython} pre
|
|
||||||
# Run test
|
|
||||||
npm install
|
npm install
|
||||||
npm run test
|
npm run test
|
||||||
# Clean-up env except log
|
|
||||||
{toxinidir}/tools/tox_helper.sh {envname} {basepython} post
|
[testenv:karma-local]
|
||||||
|
basepython = python3.5
|
||||||
|
whitelist_externals =
|
||||||
|
{[testenv:eslint]whitelist_externals}
|
||||||
|
commands =
|
||||||
|
{[testenv:karma]commands}
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
|
basepython = python3.5
|
||||||
deps =
|
deps =
|
||||||
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
||||||
-r{toxinidir}/doc/requirements.txt
|
-r{toxinidir}/doc/requirements.txt
|
||||||
commands=
|
commands=
|
||||||
sphinx-build -W -b html doc/source doc/build/html
|
sphinx-build -W -b html doc/source doc/build/html
|
||||||
|
|
||||||
|
[testenv:docs-local]
|
||||||
|
basepython = python3.5
|
||||||
|
deps =
|
||||||
|
{[testenv:docs]deps}
|
||||||
|
commands=
|
||||||
|
{[testenv:hz-local]commands}
|
||||||
|
{[testenv:docs]commands}
|
||||||
|
|
||||||
[testenv:releasenotes]
|
[testenv:releasenotes]
|
||||||
|
basepython = python3.5
|
||||||
deps =
|
deps =
|
||||||
{[testenv:docs]deps}
|
{[testenv:docs]deps}
|
||||||
commands =
|
commands =
|
||||||
@ -105,3 +125,12 @@ deps =
|
|||||||
-c{toxinidir}/lower-constraints.txt
|
-c{toxinidir}/lower-constraints.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
-r{toxinidir}/requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
|
|
||||||
|
[testenv:lower-constraints-local]
|
||||||
|
basepython = python3
|
||||||
|
deps =
|
||||||
|
{[testenv:lower-constraints]deps}
|
||||||
|
commands =
|
||||||
|
{[testenv:hz-local]commands}
|
||||||
|
{[testenv]commands}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ var path = require('path');
|
|||||||
|
|
||||||
module.exports = function (config) {
|
module.exports = function (config) {
|
||||||
// This tox venv is setup in the post-install npm step
|
// This tox venv is setup in the post-install npm step
|
||||||
var toxPath = '../.tox/karma/lib/python2.7/site-packages/';
|
var toxPath = '../.tox/karma/lib/python3.5/site-packages/';
|
||||||
|
|
||||||
process.env.PHANTOMJS_BIN = 'node_modules/phantomjs-prebuilt/bin/phantomjs';
|
process.env.PHANTOMJS_BIN = 'node_modules/phantomjs-prebuilt/bin/phantomjs';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user