From fad0c1f10112c4a7287329eb56ab78043ca2a93f Mon Sep 17 00:00:00 2001 From: Ivan Kolodyazhny Date: Sun, 20 Jan 2019 22:26:40 +0200 Subject: [PATCH] Fix npm tests on local env and CI This patch adds upper-contraints support both for Python and JavaScript tests. Change-Id: Ied15af4c3c16043f8fb657b11cfce6fc44ff006f --- package.json | 2 +- test-requirements.txt | 1 + tox.ini | 10 +++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 0193b8a..db670c4 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "karma-spec-reporter": "0.0.32" }, "scripts": { - "postinstall": "if [ ! -d .venv ]; then tox -e npm --notest; fi", + "postinstall": "if [ ! -d .tox/npm ]; then tox -e npm --notest; fi", "lint": "eslint --no-color vitrage_dashboard/static", "lintq": "eslint --quiet vitrage_dashboard/static", "test": "karma start karma.conf.js --single-run" diff --git a/test-requirements.txt b/test-requirements.txt index 717ad6a..e8b563b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,6 +7,7 @@ hacking>=1.1.0,<1.2.0 # Apache-2.0 coverage>=3.6 python-subunit>=0.0.18 sphinx>=1.6.2 # BSD +nodeenv>=0.9.4 # BSD openstackdocstheme>=1.24.0 # Apache-2.0 oslotest>=1.10.0 # Apache-2.0 testrepository>=0.0.18 diff --git a/tox.ini b/tox.ini index f26af55..39ba330 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -minversion = 2.0 +minversion = 2.3.2 envlist = py35,py27,pep8,npm skipsdist = True @@ -8,7 +8,10 @@ usedevelop = True install_command = pip install -U {opts} {packages} setenv = VIRTUAL_ENV={envdir} -deps = -r{toxinidir}/test-requirements.txt +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} + -r{toxinidir}/test-requirements.txt + -r{toxinidir}/requirements.txt commands = /bin/rm -f .testrepository/times.dbm python setup.py test --slowest --testr-args='{posargs}' @@ -30,7 +33,8 @@ commands = nodeenv -p npm install npm run {posargs:test} -deps = +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 [testenv:venv]