Update tests

- Add openstack-lower-constraints-jobs-horizon,
  openstack-python36-jobs-horizon,
  horizon-openstack-tox-python3-django111 jobs
- Add npm, lower-constrains and py3-dj111 test envs in tox.ini
- Remove django-nose
- Update horizon to 14.0.0.0b3
- Upgrade requirement & Fix npm test error [1]

[1] https://storyboard.openstack.org/#!/story/2003704

Change-Id: Id7f8975de90dee907b16ded017a869e207492985
Signed-off-by: Trinh Nguyen <dangtrinhnt@gmail.com>
Story: #2003704
Task: #26359
This commit is contained in:
Trinh Nguyen 2018-10-02 10:34:40 +09:00
parent 9582e8a639
commit ee2797c8ca
7 changed files with 92 additions and 54 deletions

View File

@ -1,17 +1,35 @@
- project:
templates:
- check-requirements
- openstack-lower-constraints-jobs-horizon
- openstack-python-jobs-horizon
- openstack-python35-jobs-horizon
- openstack-python36-jobs-horizon
- publish-openstack-docs-pti
- check-requirements
- release-notes-jobs-python3
check:
jobs:
- nodejs-npm-run-lint:
vars:
node_version: 4
voting: false
required-projects:
- openstack/horizon
- nodejs-npm-run-test:
vars:
node_version: 4
voting: false
required-projects:
- openstack/horizon
- horizon-openstack-tox-python3-django111
gate:
jobs:
- nodejs-npm-run-lint:
vars:
node_version: 4
required-projects:
- openstack/horizon
- nodejs-npm-run-test:
vars:
node_version: 4
required-projects:
- openstack/horizon
- horizon-openstack-tox-python3-django111

18
lower-constraints.txt Normal file
View File

@ -0,0 +1,18 @@
Babel==1.3 # BSD
coverage==3.6 # Apache-2.0
ddt==1.0.1 # MIT
hacking==0.12.0 # Apache-2.0
horizon==14.0.0.0b2 # Apache-2.0
nodeenv==1.3.2 # BSD
openstackdocstheme==1.18.1 # Apache-2.0
oslo.log==3.36.0 # Apache-2.0
oslotest==1.10.0 # Apache-2.0
pbr==2.0.0 # Apache-2.0
python-subunit==0.0.18 # Apache-2.0/BSD
reno==2.5.0 # Apache-2.0
selenium==2.50.1 # Apache-2.0
sphinx==1.6.2 # BSD
stestr==2.0.0 # Apache-2.0
testscenarios==0.4 # Apache-2.0/BSD
testtools==1.4.0 # MIT
xvfbwrapper==0.1.3 #license: MIT

View File

@ -13,14 +13,14 @@
"karma": "1.1.2",
"karma-chrome-launcher": "1.0.1",
"karma-cli": "1.0.1",
"karma-coverage": "1.1.1",
"karma-coverage": "^1.1.2",
"karma-jasmine": "1.0.2",
"karma-ng-html2js-preprocessor": "1.0.0",
"karma-phantomjs-launcher": "0.2.0",
"karma-threshold-reporter": "0.1.15"
},
"scripts": {
"test": "tox -evenv --notest; karma start searchlight_ui/karma.conf.js --single-run",
"postinstall": "if [ ! -d .tox ] || [ ! -d .tox/npm ]; then tox -e npm --notest; python3 -m pip install -U -t ./.tox/npm/lib/`python3 -V|tr -d ' '|tr 'P' 'p'|cut -c -9`/site-packages/ -chttps://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt ../horizon; fi",
"test": "karma start searchlight_ui/karma.conf.js --single-run",
"lint": "eslint --no-color searchlight_ui/static"
},
"dependencies": {}

View File

@ -8,4 +8,4 @@ Babel>=1.3 # BSD
# This will be installed from git in OpenStack CI if the job setting
# required-projects for horizon:
horizon>=14.0.0.0b2 # Apache-2.0
horizon>=14.0.0.0b3 # Apache-2.0

View File

@ -20,32 +20,18 @@ var fs = require('fs');
var path = require('path');
module.exports = function (config) {
var xstaticPath;
var horizonPath;
var dashboardPath;
var basePaths = [
'.tox/venv'
];
for (var i = 0; i < basePaths.length; i++) {
var basePath = path.resolve(basePaths[i]);
if (fs.existsSync(basePath)) {
xstaticPath = basePath + '/lib/python2.7/site-packages/xstatic/pkg/';
horizonPath = basePath + '/lib/python2.7/site-packages/horizon/';
dashboardPath = basePath + '/lib/python2.7/site-packages/openstack_dashboard/';
break;
}
}
var xstaticPath = path.resolve('./.tox/npm');
if (!xstaticPath) {
console.error('xStatic libraries not found, please set up tox karma env.');
console.error('basePath: ' + basePath);
console.error('dashboardPath: ' + dashboardPath);
console.error('horizonPath: ' + horizonPath);
console.error('xstaticPath: ' + xstaticPath);
console.error('xStatic libraries not found, please run `tox -e npm`');
process.exit(1);
}
xstaticPath += '/lib/';
xstaticPath += fs.readdirSync(xstaticPath).find(function(directory) {
return directory.indexOf('python') === 0;
});
var toxPath = xstaticPath + '/site-packages/';
xstaticPath = toxPath + 'xstatic/pkg/';
config.set({
preprocessors: {
@ -53,7 +39,7 @@ module.exports = function (config) {
// NOTE: the templates must also be listed in the files section below.
'./static/**/*.html': ['ng-html2js'],
// Used to indicate files requiring coverage reports.
'./static/**/!(*.spec).js': ['coverage'],
'./static/**/!(*.spec|*.borrowed-from-underscore).js': ['coverage']
},
// Sets up module to process templates.
@ -95,19 +81,19 @@ module.exports = function (config) {
xstaticPath + 'angular_schema_form/data/schema-form.js',
// TODO: These should be mocked.
horizonPath + '/static/horizon/js/horizon.js',
toxPath + 'horizon/static/horizon/js/horizon.js',
/**
* Include framework source code from horizon that we need.
* Otherwise, karma will not be able to find them when testing.
* These files should be mocked in the foreseeable future.
*/
horizonPath + '/static/framework/**/*.module.js',
horizonPath + '/static/framework/**/!(*.spec|*.mock).js',
dashboardPath + '/static/**/*.module.js',
dashboardPath + '/static/**/!(*.spec|*.mock).js',
dashboardPath + '/dashboards/**/static/**/*.module.js',
dashboardPath + '/dashboards/**/static/**/!(*.spec|*.mock).js',
toxPath + 'horizon/static/framework/**/*.module.js',
toxPath + 'horizon/static/framework/**/!(*.spec|*.mock).js',
toxPath + 'openstack_dashboard/static/**/*.module.js',
toxPath + 'openstack_dashboard/static/**/!(*.spec|*.mock).js',
toxPath + 'openstack_dashboard/dashboards/**/static/**/*.module.js',
toxPath + 'openstack_dashboard/dashboards/**/static/**/!(*.spec|*.mock).js',
/**
* First, list all the files that defines application's angular modules.
@ -128,14 +114,14 @@ module.exports = function (config) {
* Then, list files for mocks with `mock.js` extension. The order
* among them should not be significant.
*/
dashboardPath + '/static/**/*.mock.js',
toxPath + 'openstack_dashboard/static/**/*.mock.js',
//'./static/**/*.mock.js',
/**
* Finally, list files for spec with `spec.js` extension. The order
* among them should not be significant.
*/
'./static/**/*.spec.js',
'./static/app/core/openstack-service-api/searchlight.service.spec.js',
/**
* Angular external templates
@ -172,7 +158,7 @@ module.exports = function (config) {
// Coverage threshold values.
thresholdReporter: {
statements: 1,
branches: 1,
branches: 0.6,
functions: 1,
lines: 1
}

View File

@ -6,12 +6,10 @@ hacking>=0.12.0,!=0.13.0,<0.14 # Apache-2.0
coverage>=3.6 # Apache-2.0
ddt>=1.0.1 # MIT
django-nose>=1.2 # BSD
nodeenv>=1.3.2 # BSD
python-subunit>=0.0.18 # Apache-2.0/BSD
selenium>=2.50.1 # Apache-2.0
sphinx>=1.6.2 # BSD
openstackdocstheme>=1.11.0 # Apache-2.0
reno>=1.8.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
stestr>=2.0.0 # Apache-2.0
testscenarios>=0.4 # Apache-2.0/BSD

40
tox.ini
View File

@ -5,25 +5,30 @@ skipsdist = True
[testenv]
usedevelop = True
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -U {opts} {packages}
install_command = pip install -U {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
NOSE_WITH_OPENSTACK=1
NOSE_OPENSTACK_COLOR=1
NOSE_OPENSTACK_RED=0.05
NOSE_OPENSTACK_YELLOW=0.025
NOSE_OPENSTACK_SHOW_ELAPSED=1
DJANGO_SETTINGS_MODULE=searchlight_ui.tests.settings
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
whitelist_externals = /usr/bin/npm
/bin/bash
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = python manage.py test
[testenv:pep8]
basepython = python3
commands = flake8
[testenv:npm]
basepython = python3
passenv =
HOME
DISPLAY
commands =
nodeenv -p
npm install
npm run {posargs:test}
[testenv:venv]
basepython = python3
commands = {posargs}
@ -35,7 +40,7 @@ setenv =
SELENIUM_HEADLESS=1
HORIZON_INTEGRATION_TESTS_CONFIG_FILE=searchlight_ui/tests/integration_tests/horizon.conf
DJANGO_SETTINGS_MODULE=searchlight_ui.tests.settings
commands = nosetests searchlight_ui/tests/integration_tests/tests {posargs}
commands = {envpython} {toxinidir}/manage.py test --verbosity 2 --tag integration {posargs}
[testenv:cover]
basepython = python3
@ -63,6 +68,19 @@ basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
[testenv:py3-dj111]
basepython = python3
commands =
pip install django>=1.11,<2
{[testenv]commands}
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
show-source = True