Skip to content

Commit

Permalink
Add Chrome + Firefox tests (karma) during Travis CI-build.
Browse files Browse the repository at this point in the history
fixes #110
  • Loading branch information
Shahar Soel committed Dec 25, 2015
1 parent d8f987d commit fa4351e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 20 deletions.
43 changes: 27 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,43 @@
language: node_js
sudo: required
dist: trusty
cache:
directories:
- node_modules
matrix:
include:
# - node_js: "5"
# env: CXX=g++-4.8 GRUNT_TASK=unit_tests DEPLOY=true
# - node_js: "4"
# env: CXX=g++-4.8 GRUNT_TASK=unit_tests
# - node_js: "0.12"
# env: CXX=g++-4.8 GRUNT_TASK=unit_tests
# - node_js: "0.10"
# env: CXX=g++-4.8 GRUNT_TASK=unit_tests
# - node_js: "5"
# env: CXX=g++-4.8 GRUNT_TASK=integration_tests
# - node_js: "4"
# env: CXX=g++-4.8 GRUNT_TASK=integration_tests
# - node_js: "0.12"
# env: CXX=g++-4.8 GRUNT_TASK=integration_tests
# - node_js: "0.10"
# env: CXX=g++-4.8 GRUNT_TASK=integration_tests
- node_js: "5"
env: CXX=g++-4.8 GRUNT_TASK=unit_tests DEPLOY=true
- node_js: "4"
env: CXX=g++-4.8 GRUNT_TASK=unit_tests
- node_js: "0.12"
env: CXX=g++-4.8 GRUNT_TASK=unit_tests
- node_js: "0.10"
env: CXX=g++-4.8 GRUNT_TASK=unit_tests
- node_js: "5"
env: CXX=g++-4.8 GRUNT_TASK=integration_tests
- node_js: "4"
env: CXX=g++-4.8 GRUNT_TASK=integration_tests
- node_js: "0.12"
env: CXX=g++-4.8 GRUNT_TASK=integration_tests
- node_js: "0.10"
env: CXX=g++-4.8 GRUNT_TASK=integration_tests
env: CXX=g++-4.8 GRUNT_TASK=browsers_tests
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
before_install: npm install -g grunt-cli bower
firefox: latest
before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- npm install -g grunt-cli bower
- curl -Lo chrome.zip https://download-chromium.appspot.com/dl/Linux_x64 && unzip chrome.zip
# - chmod +x ./chrome-linux/chrome
- export CHROME_BIN=chrome-linux/chrome
install:
- npm install
- bower install
Expand Down
5 changes: 3 additions & 2 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ module.exports = function(grunt) {

dev_build: {},

tests_on_browsers: {
browsers_tests: {
options: {
files: ['bower_components/lodash/lodash.js', 'test.config.js', 'bin/chevrotain.js', 'bin/chevrotainSpecs.js'],
browsers: ['Chrome', 'Firefox', 'IE']
browsers: ['Chrome_travis_ci', "Firefox"]
}
}
},
Expand Down Expand Up @@ -362,6 +362,7 @@ module.exports = function(grunt) {
grunt.registerTask('build_test', buildTestTasks)
grunt.registerTask('unit_tests', unitTestsTasks)
grunt.registerTask('integration_tests', integrationTestsTasks)
grunt.registerTask('browsers_tests', "karma:browsers_tests")

grunt.registerTask('dev_build_test', [
'clean:dev',
Expand Down
10 changes: 8 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*global module process */
var specsFiles = require('./scripts/findSpecs')("bin/gen/test/", "test")
var findRefs = require('./scripts/findRefs')
var _ = require('lodash')
Expand All @@ -10,7 +9,7 @@ coreIncludes = _.reject(coreIncludes, function(srcFile) {

coreIncludes = _.map(coreIncludes, function(srcFile) {
var fixedPath = srcFile.replace('src', 'bin/gen/src')
var fixedSuffix = fixedPath.replace('.ts', '.js')
var fixedSuffix = fixedPath.replace('.ts', '.js')
return fixedSuffix
})

Expand Down Expand Up @@ -64,6 +63,13 @@ module.exports = function(config) {
// - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
browsers: ['Chrome'],

customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},

// If browser does not capture in given timeout [ms], kill it
captureTimeout: 10000000,
browserNoActivityTimeout: 60000,
Expand Down

0 comments on commit fa4351e

Please sign in to comment.