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 15b4c6bd0a
commit 1f30c1d2b0
3 changed files with 15 additions and 17 deletions

View File

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

View File

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

18
tox.ini
View File

@ -39,15 +39,21 @@ commands =
whitelist_externals = npm whitelist_externals = npm
commands = commands =
npm install npm install
npm run {posargs:postinstall} npm run postinstall
npm run {posargs:lint} npm run lint
[testenv:karma] [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 = commands =
npm install echo "npm can't launch Chromium via tox."
npm run {posargs:postinstall} echo "nexecute `npm run test`"
npm run {posargs:test}
[testenv:docs] [testenv:docs]
setenv = DJANGO_SETTINGS_MODULE=magnum_ui.test.settings setenv = DJANGO_SETTINGS_MODULE=magnum_ui.test.settings