diff --git a/{{cookiecutter.repo_name}}/.zuul.yaml b/{{cookiecutter.repo_name}}/.zuul.yaml index 840ece9..c7992e8 100644 --- a/{{cookiecutter.repo_name}}/.zuul.yaml +++ b/{{cookiecutter.repo_name}}/.zuul.yaml @@ -1,6 +1,8 @@ - project: check: jobs: + - openstack-tox-py36: + voting: false - horizon-openstack-tox-python3-django111 - nodejs-npm-run-lint: vars: diff --git a/{{cookiecutter.repo_name}}/package.json b/{{cookiecutter.repo_name}}/package.json index 42c8069..0c29e10 100644 --- a/{{cookiecutter.repo_name}}/package.json +++ b/{{cookiecutter.repo_name}}/package.json @@ -26,7 +26,7 @@ }, "dependencies": {}, "scripts": { - "postinstall": "if [ ! -d .tox ] || [ ! -d .tox/karma ]; then tox -ekarma --notest; python3.5 -m pip install -U -t ./.tox/karma/lib/python3.5/site-packages/ ../horizon; fi", + "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/ ../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" diff --git a/{{cookiecutter.repo_name}}/tox.ini b/{{cookiecutter.repo_name}}/tox.ini index fe1648c..e9bc582 100644 --- a/{{cookiecutter.repo_name}}/tox.ini +++ b/{{cookiecutter.repo_name}}/tox.ini @@ -59,6 +59,12 @@ commands = {[testenv:hz-local]commands} {[testenv]commands} +[testenv:py36-local] +basepython = python3.6 +commands = + {[testenv:hz-local]commands} + {[testenv]commands} + [testenv:py3-dj111] basepython = python3 commands = @@ -81,7 +87,7 @@ commands = npm run lint # NOTE(shu-mutow): The "postinstall" script on package.json will install horizon -# from master branch into py35 environment for testing javascripts. +# from master branch into python3.x environment for testing javascripts. # Horizon from master is needed to be cloned into ../horizon on both local and CI. [testenv:karma] basepython = python3 diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.module_name}}/karma.conf.js b/{{cookiecutter.repo_name}}/{{cookiecutter.module_name}}/karma.conf.js index 2474ad8..6e713d7 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.module_name}}/karma.conf.js +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.module_name}}/karma.conf.js @@ -16,10 +16,15 @@ var fs = require('fs'); var path = require('path'); +var child_process = require("child_process"); module.exports = function (config) { - var toxPath = '../.tox/karma/lib/python3.5/site-packages/'; + var pythonVersion = "python3."; + var stdout = child_process.execFileSync("python3", ["--version"]); + pythonVersion += stdout.toString().split(".")[1]; + var toxPath = '../.tox/karma/lib/' + pythonVersion + '/site-packages/'; + console.log("Karma will check on directory: ", toxPath); process.env.PHANTOMJS_BIN = 'node_modules/phantomjs-prebuilt/bin/phantomjs';