New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Karma chameleon #1187
Karma chameleon #1187
Changes from 39 commits
b7cc2a8
204bb84
799f176
61eb54a
aeb4aa3
06e141d
efe25c0
6a097c0
d784f9d
c7e35e5
95c29e6
aa8d50b
4e0c2b3
35d7258
9d25874
d8f721a
2fca844
2473d5b
3bafdee
31918fc
4660573
c1029ea
e8722ff
65833f5
f98012a
8c9a4cc
f4704ee
16eea0a
923ce03
227700a
22d306a
e379afc
321b005
0737ea2
70f5c6f
4679b4d
3eb2d8f
391fc26
6baa603
3dcb902
929e87b
38c25b1
bdcc638
d96e008
3e5ef19
27f0f78
e7617bf
a5bc688
adf4e50
269f7b1
ef25557
dbff62e
1df28ff
a671891
3fd0c92
bcb69a0
92eac13
7782eda
4bb3a23
0156742
3667d38
d7f840a
047bd8f
8dfe0a4
617319e
d97f143
e999af5
bad5130
0c3fb04
97c1f83
8c6dc84
6c7a914
6dfc9a7
16a263e
070edd6
1a64dbd
891f39f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
"define", | ||
"module", | ||
"exports", | ||
"process", | ||
|
||
"PlayerTest", | ||
"asyncTest", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
language: node_js | ||
node_js: | ||
- 0.8 | ||
- 0.10 | ||
before_script: | ||
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then curl https://gist.githubusercontent.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash; fi | ||
notifications: | ||
irc: | ||
channels: | ||
- "chat.freenode.net#videojs" | ||
use_notice: true | ||
env: | ||
global: | ||
- secure: K6JpKwMkfNaJix3Bb0tLjVMzHMJgtBXdd/dvfw1BMb9DCBpd81PqXbDs7yXCddUxnUPTBPxZCrQgWsw71Wn+qEoIG5MU3uOT5A2rBbx/yZonVAGv5ed/9w0xk0OzO383CmPMFqwqtp9YmdmqGjQBkYXVXJjTvNTOAExFSdhO+3U= | ||
- secure: GIbhjUJapvC70nIZVlhVyK+3KAD2TVKpiY/q412OO7V2izbvcM1tvU3LBoMZbROzrt5TT84tCoJDvHnrpL0OvxPwrzL5CUU7h4UTxhTOyQkEinbYAnWlW9wdrvtdczsEvANkFPqBZ53B3hVHZHMLOG8QRWaTBicF68vSHEJFqb4= |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,16 +135,97 @@ module.exports = function(grunt) { | |
} | ||
}, | ||
karma: { | ||
// this config file applies to all following configs except if overwritten | ||
options: { | ||
configFile: 'test/karma.conf.js' | ||
}, | ||
|
||
// this only runs on PRs from the mainrepo on saucelabs | ||
saucelabs: { | ||
browsers: ['chrome_sl', 'ipad_sl'] | ||
}, | ||
|
||
// these are run locally on local browsers | ||
dev: { | ||
configFile: 'test/karma.conf.js', | ||
autoWatch: true | ||
browsers: ['Chrome', 'Firefox', 'Safari'] | ||
}, | ||
chromecanary: { | ||
browsers: ['ChromeCanary'] | ||
}, | ||
chrome: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does having these individual browser definitions get us? |
||
browsers: ['Chrome'] | ||
}, | ||
firefox: { | ||
browsers: ['Firefox'] | ||
}, | ||
safari: { | ||
browsers: ['Safari'] | ||
}, | ||
ie: { | ||
browsers: ['IE'] | ||
}, | ||
phantomjs: { | ||
browsers: ['PhantomJS'] | ||
}, | ||
|
||
// This is all the minified tests run locally on local browsers | ||
minified_dev: { | ||
browsers: ['Chrome', 'Firefox', 'Safari'], | ||
configFile: 'test/karma.minified.conf.js' | ||
}, | ||
minified_chromecanary: { | ||
browsers: ['ChromeCanary'], | ||
configFile: 'test/karma.minified.conf.js' | ||
}, | ||
minified_chrome: { | ||
browsers: ['Chrome'], | ||
configFile: 'test/karma.minified.conf.js' | ||
}, | ||
minified_firefox: { | ||
browsers: ['Firefox'], | ||
configFile: 'test/karma.minified.conf.js' | ||
}, | ||
minified_safari: { | ||
browsers: ['Safari'], | ||
configFile: 'test/karma.minified.conf.js' | ||
}, | ||
minified_ie: { | ||
browsers: ['IE'], | ||
configFile: 'test/karma.minified.conf.js' | ||
}, | ||
minified_phantomjs: { | ||
browsers: ['PhantomJS'], | ||
configFile: 'test/karma.minified.conf.js' | ||
}, | ||
|
||
// This is all the minified api tests run locally on local browsers | ||
minified_api_dev: { | ||
browsers: ['Chrome', 'Firefox', 'Safari'], | ||
configFile: 'test/karma.minified.api.conf.js' | ||
}, | ||
ci: { | ||
configFile: 'test/karma.conf.js', | ||
autoWatch: false | ||
minified_api_chromecanary: { | ||
browsers: ['ChromeCanary'], | ||
configFile: 'test/karma.minified.api.conf.js' | ||
}, | ||
minified_api_chrome: { | ||
browsers: ['Chrome'], | ||
configFile: 'test/karma.minified.api.conf.js' | ||
}, | ||
minified_api_firefox: { | ||
browsers: ['Firefox'], | ||
configFile: 'test/karma.minified.api.conf.js' | ||
}, | ||
minified_api_safari: { | ||
browsers: ['Safari'], | ||
configFile: 'test/karma.minified.api.conf.js' | ||
}, | ||
minified_api_ie: { | ||
browsers: ['IE'], | ||
configFile: 'test/karma.minified.api.conf.js' | ||
}, | ||
minified_api_phantomjs: { | ||
browsers: ['PhantomJS'], | ||
configFile: 'test/karma.minified.api.conf.js' | ||
} | ||
}, | ||
vjsdocs: { | ||
|
@@ -235,7 +316,50 @@ module.exports = function(grunt) { | |
grunt.registerTask('default', ['jshint', 'less', 'build', 'minify', 'usebanner', 'dist']); | ||
// Development watch task | ||
grunt.registerTask('dev', ['jshint', 'less', 'build', 'qunit:source']); | ||
grunt.registerTask('test', ['jshint', 'less', 'build', 'minify', 'usebanner', 'qunit']); | ||
grunt.registerTask('test-qunit', ['jshint', 'less', 'build', 'minify', 'usebanner', 'qunit']); | ||
|
||
// The test task will run `karma:saucelabs` when running in travis, | ||
// when running via a PR from a fork, it'll run qunit tests in phantom using karma | ||
// otherwise, it'll run the tests in chrome via karma | ||
grunt.registerTask('test', function() { | ||
var tasks = this.args, | ||
tasksMinified, | ||
tasksMinifiedApi; | ||
|
||
grunt.task.run(['jshint', 'less', 'build', 'minify', 'usebanner']); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've had issues with assuming grunt.task.run would happen synchronously inside a function like this. It seems to be working fine here, but just a warning. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
to be run. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh interesting. Sorry, I didn't look deep enough to realize you were manipulating the tasks array with this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And now I understand my previous issues with grunt.task.run... :-P. I was assuming the tasks would be run inline. |
||
|
||
if (process.env.TRAVIS_PULL_REQUEST) { | ||
grunt.task.run(['karma:phantomjs', 'karma:minified_phantomjs', 'karma:minified_api_phantomjs']); | ||
} else if (process.env.TRAVIS) { | ||
grunt.task.run(['karma:saucelabs']); | ||
} else { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is cool stuff. It could also use some more comments I think. It's a little hard to jump in and know what's going on. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll add a comment explaining this. |
||
if (tasks.length === 0) { | ||
tasks.push('chrome'); | ||
} | ||
if (tasks.length === 1) { | ||
tasks = tasks[0].split(','); | ||
} | ||
|
||
tasksMinified = tasks.slice(); | ||
tasksMinifiedApi = tasks.slice(); | ||
|
||
tasksMinified = tasksMinified.map(function(task) { | ||
return 'minified_' + task; | ||
}); | ||
|
||
tasksMinifiedApi = tasksMinifiedApi.map(function(task) { | ||
return 'minified_api_' + task; | ||
}); | ||
|
||
tasks = tasks.concat(tasksMinified).concat(tasksMinifiedApi); | ||
tasks = tasks.map(function(el) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. el? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. an element of the list but probably should be renamed to task. Especially since it'll then be consistent with the above maps. |
||
return 'karma:' + el; | ||
}); | ||
|
||
|
||
grunt.task.run(tasks); | ||
} | ||
}); | ||
|
||
var fs = require('fs'), | ||
gzip = require('zlib').gzip; | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any threat of this URL being changed/compromised?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is, but it's unlikely. This is the recommended approach from saucelabs themselves.