commit e3653e992d4fa6b45e7550f1e0b76b8978b5037f Author: Ivan Kolodyazhny Date: Fri Sep 25 18:39:44 2020 +0300 Add npm tox env With this tox env CI will run JavaScript tests instead of skipping them. This patch also fixes issues with running tests using lates Horizon release. Depends-On: https://review.opendev.org/755003 Change-Id: I3ddd4893ae60a326751c157f0be85b084a2174a4 (cherry picked from commit 0d997bf6ca55b9f04e3101935152c53ab9b21353) diff --git a/ironic_ui/karma.conf.js b/ironic_ui/karma.conf.js index 5d54a62..2385e65 100644 --- a/ironic_ui/karma.conf.js +++ b/ironic_ui/karma.conf.js @@ -66,6 +66,7 @@ toxPath + 'xstatic/pkg/objectpath/data/ObjectPath.js', toxPath + 'xstatic/pkg/angular_schema_form/data/schema-form.js', toxPath + '/horizon/static/horizon/js/horizon.js', + toxPath + '/horizon/static/horizon/js/horizon.uuid.js', /** * Include framework source code from horizon that we need. diff --git a/lower-constraints.txt b/lower-constraints.txt index c7cf619..235022c 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -45,6 +45,7 @@ msgpack==0.5.6 munch==2.2.0 netaddr==0.7.19 netifaces==0.10.6 +nodeenv==0.9.4 openstacksdk==0.12.0 os-client-config==1.29.0 os-service-types==1.2.0 diff --git a/test-requirements.txt b/test-requirements.txt index ae17714..c8ffc5c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,6 +5,7 @@ hacking>=3.1.0,<=3.2.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 +nodeenv>=0.9.4 # BSD python-subunit>=1.0.0 # Apache-2.0/BSD oslotest>=3.2.0 # Apache-2.0 testrepository>=0.0.18 # Apache-2.0/BSD diff --git a/tox.ini b/tox.ini index 3003d78..9d6924f 100644 --- a/tox.ini +++ b/tox.ini @@ -42,6 +42,15 @@ commands = pip install {env:HORIZON_REPO:git+https://opendev.org/openstack/horizon} {[testenv]commands} +[testenv:npm] +passenv = + HOME + DISPLAY +commands = + nodeenv -p + npm install + npm run {posargs:test} + [testenv:cover] commands = python setup.py test --coverage --testr-args='{posargs}'