Skip to content
This repository has been archived by the owner on Jan 29, 2019. It is now read-only.

Commit

Permalink
update travis config (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
squarebracket authored and mjneil committed Mar 6, 2018
1 parent a8e11fa commit 1736512
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 43 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/*
32 changes: 14 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,21 @@ language: node_js
node_js:
- 'node'
- 'lts/argon'
cache:
directories:
- node_modules
before_script:
# check if the current version is equal to the version for the env
- 'export IS_INSTALLED="$(npm list video.js | grep "video.js@$VJS")"'
# we have to add semi colons to the end of each line in the if
# as travis runs this all on one line
- 'if [ -z "$IS_INSTALLED" ]; then
echo "INSTALLING video.js@>=$VJS.0.0-RC.0 <$(($VJS+1)).0.0";
npm i "video.js@>=$VJS.0.0-RC.0 <\$(($VJS+1)).0.0";
else
echo "video.js@$VJS ALREADY INSTALLED";
fi'
- export CHROME_BIN=/usr/bin/google-chrome
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# always install the appropriate version of video.js for the environment
- npm i "video.js@$VJS";
# pulseaudio is needed for dockerized chrome since it has a dummy sink and
# the dummy audio ALSA kernel module isn't loaded by Travis
# libavcodec54 is needed by firefox for h.264 support
- sudo apt-get install --no-install-recommends pulseaudio libavcodec54
- pulseaudio -D
env:
- VJS=5
- VJS=6
matrix:
- VJS=5
- VJS=6
addons:
# TODO: This should be using latest for firefox. It is currently turned off because
# of https://github.com/travis-ci/travis-ci/issues/8242 When this issue is
# resolved, this should be updated back to latest
chrome: stable
firefox: latest
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@
"doctoc": "^0.15.0",
"glob": "^6.0.3",
"jsdoc": "^3.4.0",
"karma": "^0.13.0",
"karma": "^2.0.0",
"karma-browserify": "^4.4.0",
"karma-chrome-launcher": "^2.2.0",
"karma-detect-browsers": "^2.0.0",
"karma-firefox-launcher": "^0.1.0",
"karma-ie-launcher": "^0.2.0",
"karma-firefox-launcher": "^1.1.0",
"karma-ie-launcher": "^1.0.0",
"karma-qunit": "^0.1.0",
"karma-safari-launcher": "^0.1.0",
"karma-safari-launcher": "^1.0.0",
"lodash-compat": "^3.10.0",
"minimist": "^1.2.0",
"nodemon": "^1.9.1",
Expand Down
48 changes: 27 additions & 21 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
module.exports = function(config) {
var detectBrowsers = {
enabled: false,
usePhantomJS: false,
postDetection: function(availableBrowsers) {
var safariIndex = availableBrowsers.indexOf('Safari');

if(safariIndex !== -1) {
availableBrowsers.splice(safariIndex, 1);
console.log("Disabled Safari as it was/is not supported");
// detect what browsers are installed on the system and
// use headless mode and flags to allow for playback
postDetection: function(browsers) {
var newBrowsers = [];
if (browsers.indexOf('Chrome') !== -1) {
newBrowsers.push('ChromeHeadlessWithFlags');
}
return availableBrowsers;
}
};

// TODO: This should include firefox. It is currently turned off because
// of https://github.com/travis-ci/travis-ci/issues/8242 When this issue is
// resolved, this should be updated to include firefox
if (process.env.TRAVIS) {
config.browsers = ['ChromeHeadless'];
}
if (browsers.indexOf('Firefox') !== -1) {
newBrowsers.push('FirefoxHeadless');
}

// If no browsers are specified, we enable `karma-detect-browsers`
// this will detect all browsers that are available for testing
if (!config.browsers.length) {
detectBrowsers.enabled = true;
}
return newBrowsers;
}
};

config.set({
basePath: '..',
Expand All @@ -46,13 +38,27 @@ module.exports = function(config) {
preprocessors: {
'test/**/*.js': ['browserify']
},
customLaunchers: {
ChromeHeadlessWithFlags: {
base: 'ChromeHeadless',
flags: [
'--mute-audio',
'--no-sandbox',
'--no-user-gesture-required'
]
}
},
detectBrowsers: detectBrowsers,
reporters: ['dots'],
port: 9876,
colors: true,
autoWatch: false,
singleRun: true,
concurrency: Infinity,
concurrency: 1,
captureTimeout: 300000,
browserNoActivityTimeout: 300000,
browserDisconnectTimeout: 300000,
browserDisconnectTolerance: 3,
browserify: {
debug: true,
transform: [
Expand Down

0 comments on commit 1736512

Please sign in to comment.