Use Chrome for JS unit tests

PhantomJS has setup issues and is slowing down the gate with false
failures. We should change to Chrome until Phantom is more
reliable, at which point this patch can be reverted.

Change-Id: Ifb3c8f1bcc27ea79151a44b0d044f46e1d856f6d
This commit is contained in:
Shu Muto 2016-09-26 18:47:59 +09:00
parent 472a1b93e6
commit 499c4b5ed0
3 changed files with 15 additions and 17 deletions

View File

@ -120,20 +120,14 @@ module.exports = function (config) {
frameworks: ['jasmine'],
browsers: ['PhantomJS'],
browsers: ['Chrome'],
browserNoActivityTimeout: 60000,
phantomjsLauncher: {
// Have phantomjs exit if a ResourceError is encountered
// (useful if karma exits without killing phantom)
exitOnResourceError: true
},
reporters: ['progress', 'coverage', 'threshold'],
plugins: [
'karma-phantomjs-launcher',
'karma-chrome-launcher',
'karma-jasmine',
'karma-ng-html2js-preprocessor',
'karma-coverage',

View File

@ -20,9 +20,7 @@
"karma-coverage": "1.1.1",
"karma-jasmine": "1.0.2",
"karma-ng-html2js-preprocessor": "1.0.0",
"karma-phantomjs-launcher": "0.2.0",
"karma-threshold-reporter": "0.1.15",
"phantomjs": "1.9.17"
"karma-threshold-reporter": "0.1.15"
},
"dependencies": {},
"scripts": {

18
tox.ini
View File

@ -39,15 +39,21 @@ commands =
whitelist_externals = npm
commands =
npm install
npm run {posargs:postinstall}
npm run {posargs:lint}
npm run postinstall
npm run lint
[testenv:karma]
whitelist_externals = npm
# NOTE(shu-mutou): Until PhantomJS setup get reliable, we use
# Chromium for JS test. And npm can't launch Chromium via tox.
#whitelist_externals = npm
#commands =
# npm install
# npm run postinstall
# npm run test
whitelist_externals = echo
commands =
npm install
npm run {posargs:postinstall}
npm run {posargs:test}
echo "npm can't launch Chromium via tox."
echo "nexecute `npm run test`"
[testenv:docs]
setenv = DJANGO_SETTINGS_MODULE=magnum_ui.test.settings