b644fa95 by Gary Katsevman

Merge pull request #36 from videojs/saucytravis3_thefinaldimension

Karma and saucelabs integration with travis-ci.
2 parents 3412f5fc 76b977c7
1 language: node_js 1 language: node_js
2 node_js:
3 - '0.8'
2 before_script: 4 before_script:
3 - npm install -g grunt-cli 5 - npm install -g grunt-cli
6 - curl https://gist.github.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash
4 notifications: 7 notifications:
5 hipchat: 8 hipchat:
6 rooms: 9 rooms:
7 secure: l5TTd5JuPAW883PtcyaIBcJI9Chr9JpsZPQAEUBKAgIEwzuS6y7t5arlkS1PwH6gi1FADzYDf+OXSIou4GkTSrIetnBcT/SAgF0gBKgIhj+eRkuCfZ4VaC7BPhfZ0hgYRE+5Ejf5BM2MJafRm0pj7OlqG4xKrQZwtuV1te5r3JY= 10 secure: l5TTd5JuPAW883PtcyaIBcJI9Chr9JpsZPQAEUBKAgIEwzuS6y7t5arlkS1PwH6gi1FADzYDf+OXSIou4GkTSrIetnBcT/SAgF0gBKgIhj+eRkuCfZ4VaC7BPhfZ0hgYRE+5Ejf5BM2MJafRm0pj7OlqG4xKrQZwtuV1te5r3JY=
11 irc: chat.freenode.net#videojs
12 addons:
13 sauce_connect:
14 username:
15 secure: "Y++AtTlMXkcPAx+K0cL6uzn4FlmfiIki5bkGCkowoYSCxq1X9tNta39JONSVSeZKBlP58GJwNJdB4Wq1CpJL4NriGc3UvpcgNcrILGOWLczX0zFvXkOIaLn0bUuierf4wzUjk3i6XOh83NrMaX+gBHXb8RVUEBf2z0/WM3zHrEM="
16 access_key:
17 secure: "bCan88WIWqm6jP4ZtDbLVrrGXe1a33otfQhi7SYp95wHFLemUHS1JyXv+HbbbsW5dNjatfdhzvc47bpw4LbccL6evVR9sb2Tld15TxW2a2WQtMPzvOfj55aP1YQtIxYwy14swifWGK/Lj/A0ZUCUNolCf7DjCK6hZGaWaDRtdIE="
......
...@@ -32,7 +32,7 @@ module.exports = function(grunt) { ...@@ -32,7 +32,7 @@ module.exports = function(grunt) {
32 'src/segment-parser.js', 32 'src/segment-parser.js',
33 'src/stream.js', 33 'src/stream.js',
34 'src/m3u8/m3u8-parser.js' 34 'src/m3u8/m3u8-parser.js'
35 ], 35 ],
36 dest: 'dist/videojs.hls.js' 36 dest: 'dist/videojs.hls.js'
37 } 37 }
38 }, 38 },
...@@ -107,10 +107,90 @@ module.exports = function(grunt) { ...@@ -107,10 +107,90 @@ module.exports = function(grunt) {
107 logConcurrentOutput: true 107 logConcurrentOutput: true
108 } 108 }
109 } 109 }
110 } 110 },
111 karma: {
112 options: {
113 frameworks: ['qunit']
114 },
115
116 saucelabs: {
117 configFile: 'test/karma.conf.js',
118 autoWatch: true
119 },
120
121 dev: {
122 browsers: ['Chrome', 'Safari', 'Firefox',
123 'Opera', 'IE', 'PhantomJS', 'ChromeCanary'],
124 configFile: 'test/localkarma.conf.js',
125 autoWatch: true
126 },
127
128 chromecanary: {
129 options: {
130 browsers: ['ChromeCanary'],
131 configFile: 'test/localkarma.conf.js',
132 autoWatch: true
133 }
134 },
135
136 phantomjs: {
137 options: {
138 browsers: ['PhantomJS'],
139 configFile: 'test/localkarma.conf.js',
140 autoWatch: true
141 }
142 },
143
144 opera: {
145 options: {
146 browsers: ['Opera'],
147 configFile: 'test/localkarma.conf.js',
148 autoWatch: true
149 }
150 },
151
152 chrome: {
153 options: {
154 browsers: ['Chrome'],
155 configFile: 'test/localkarma.conf.js',
156 autoWatch: true
157 }
158 },
159
160 safari: {
161 options: {
162 browsers: ['Safari'],
163 configFile: 'test/localkarma.conf.js',
164 autoWatch: true
165 }
166 },
167
168 firefox: {
169 options: {
170 browsers: ['Firefox'],
171 configFile: 'test/localkarma.conf.js',
172 autoWatch: true
173 }
174 },
175
176 ie: {
177 options: {
178 browsers: ['IE'],
179 configFile: 'test/localkarma.conf.js',
180 autoWatch: true
181 }
182 },
183
184 ci: {
185 configFile: 'test/karma.conf.js',
186 autoWatch: false
187 }
188 },
189
111 }); 190 });
112 191
113 // These plugins provide necessary tasks. 192 // These plugins provide necessary tasks.
193 grunt.loadNpmTasks('grunt-karma');
114 grunt.loadNpmTasks('grunt-contrib-clean'); 194 grunt.loadNpmTasks('grunt-contrib-clean');
115 grunt.loadNpmTasks('grunt-contrib-concat'); 195 grunt.loadNpmTasks('grunt-contrib-concat');
116 grunt.loadNpmTasks('grunt-contrib-uglify'); 196 grunt.loadNpmTasks('grunt-contrib-uglify');
...@@ -120,6 +200,9 @@ module.exports = function(grunt) { ...@@ -120,6 +200,9 @@ module.exports = function(grunt) {
120 grunt.loadNpmTasks('grunt-contrib-connect'); 200 grunt.loadNpmTasks('grunt-contrib-connect');
121 grunt.loadNpmTasks('grunt-open'); 201 grunt.loadNpmTasks('grunt-open');
122 grunt.loadNpmTasks('grunt-concurrent'); 202 grunt.loadNpmTasks('grunt-concurrent');
203 grunt.loadNpmTasks('grunt-saucelabs');
204 grunt.loadNpmTasks('grunt-contrib-watch');
205
123 206
124 grunt.registerTask('manifests-to-js', 'Wrap the test fixtures and output' + 207 grunt.registerTask('manifests-to-js', 'Wrap the test fixtures and output' +
125 ' so they can be loaded in a browser', 208 ' so they can be loaded in a browser',
...@@ -177,4 +260,10 @@ module.exports = function(grunt) { ...@@ -177,4 +260,10 @@ module.exports = function(grunt) {
177 'concat', 260 'concat',
178 'uglify']); 261 'uglify']);
179 262
263 grunt.registerTask('test', ['manifests-to-js', 'karma:saucelabs']);
264
265 // travis build task
266 grunt.registerTask('build:travis', ['jshint', 'test:node', 'test:sauce-browser']);
267
268
180 }; 269 };
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
10 }, 10 },
11 "license": "Apache 2", 11 "license": "Apache 2",
12 "scripts": { 12 "scripts": {
13 "test": "grunt" 13 "test": "grunt test"
14 }, 14 },
15 "devDependencies": { 15 "devDependencies": {
16 "grunt-contrib-jshint": "~0.6.0", 16 "grunt-contrib-jshint": "~0.6.0",
...@@ -24,6 +24,16 @@ ...@@ -24,6 +24,16 @@
24 "grunt-open": "0.2.3", 24 "grunt-open": "0.2.3",
25 "grunt-shell": "0.6.1", 25 "grunt-shell": "0.6.1",
26 "grunt": "~0.4.1", 26 "grunt": "~0.4.1",
27 "grunt-karma": "~0.6.2",
28 "karma": "~0.10.0",
29 "karma-sauce-launcher": "~0.1.8",
30 "karma-chrome-launcher": "~0.1.2",
31 "karma-firefox-launcher": "~0.1.3",
32 "karma-ie-launcher": "~0.1.1",
33 "karma-opera-launcher": "~0.1.0",
34 "karma-phantomjs-launcher": "~0.1.1",
35 "karma-safari-launcher": "~0.1.1",
36 "karma-qunit": "~0.1.1"
27 "video.js": "^4.5" 37 "video.js": "^4.5"
28 }, 38 },
29 "peerDependencies": { 39 "peerDependencies": {
......
1
2
3 var fixture = document.createElement('div');
4 fixture.id = 'qunit-fixture';
5 document.body.appendChild(fixture);
1 // Karma example configuration file
2 // NOTE: To configure Karma tests, do the following:
3 // 1. Copy this file and rename the copy with a .conf.js extension, for example: karma.conf.js
4 // 2. Configure the properties below in your conf.js copy
5 // 3. Run your tests
6
7 module.exports = function(config) {
8 config.set({
9 // base path, that will be used to resolve files and exclude
10 basePath: '',
11
12 frameworks: ['qunit'],
13
14 // Set autoWatch to true if you plan to run `grunt karma` continuously, to automatically test changes as you make them.
15 autoWatch: false,
16
17 // Setting singleRun to true here will start up your specified browsers, run tests, and then shut down the browsers. Helpful to have in a CI environment, where you don't want to leave browsers running continuously.
18 singleRun: true,
19
20 // Start these browsers, currently available:
21 // - Chrome
22 // - ChromeCanary
23 // - Firefox
24 // - Opera
25 // - Safari (only Mac)
26 // - PhantomJS
27 // - IE (only Windows)
28 // Example usage:
29 browsers: ['chrome_test',
30 //'firefox_test',
31 //'safari_test', '
32 //'ipad_test',
33 'android_test'],
34
35 // List of files / patterns to load in the browser
36 // Add any new src files to this list.
37 // If you add new unit tests, they will be picked up automatically by Karma,
38 // unless you've added them to a nested directory, in which case you should
39 // add their paths to this list.
40
41 files: [
42 '../node_modules/video.js/dist/video-js/video.js',
43 '../node_modules/videojs-contrib-media-sources/videojs-media-sources.js',
44 '../test/karma-qunit-shim.js',
45 "../src/videojs-hls.js",
46 "../src/flv-tag.js",
47 "../src/exp-golomb.js",
48 "../src/h264-stream.js",
49 "../src/aac-stream.js",
50 "../src/segment-parser.js",
51 "../src/stream.js",
52 "../src/m3u8/m3u8-parser.js",
53 "../tmp/manifests.js",
54 "../tmp/expected.js",
55 "tsSegment-bc.js",
56 "../src/bin-utils.js",
57 "../src/async-queue.js",
58 '../test/*.js'
59 ],
60
61 plugins: [
62 'karma-qunit',
63 'karma-chrome-launcher',
64 'karma-firefox-launcher',
65 'karma-ie-launcher',
66 'karma-opera-launcher',
67 'karma-phantomjs-launcher',
68 'karma-safari-launcher',
69 'karma-sauce-launcher'
70 ],
71
72 // list of files to exclude
73 exclude: [
74
75 ],
76
77
78 // test results reporter to use
79 // possible values: 'dots', 'progress', 'junit'
80 reporters: ['progress'],
81
82
83 // web server port
84 port: 9876,
85
86 // cli runner port
87 runnerPort: 9100,
88
89 // enable / disable colors in the output (reporters and logs)
90 colors: true,
91
92 // level of logging
93 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
94 //logLevel: config.LOG_INFO,
95
96 // If browser does not capture in given timeout [ms], kill it
97 captureTimeout: 60000,
98
99 // global config for SauceLabs
100 sauceLabs: {
101 username: "sheff555",
102 accessKey: "d04372cc-0fc3-4e59-aa02-3cfd9df03240",
103 startConnect: true,
104 tunnelIdentifier: 'uniquekarmaidentifier',
105 testName: 'ps test sample'
106 },
107
108 //define SL browsers
109 customLaunchers: {
110 chrome_test: {
111 singleRun: true,
112 base: 'SauceLabs',
113 browserName: 'chrome',
114 platform: 'Windows XP'
115 },
116
117 firefox_test: {
118 singleRun: true,
119 base: 'SauceLabs',
120 browserName: 'firefox',
121 platform: 'Windows 8'
122 },
123
124 safari_test: {
125 singleRun: true,
126 base: 'SauceLabs',
127 browserName: 'safari',
128 platform: 'OS X 10.8'
129 },
130
131 ipad_test: {
132 singleRun: true,
133 base: 'SauceLabs',
134 browserName: 'ipad',
135 platform:'OS X 10.8'
136 },
137
138 android_test: {
139 singleRun: true,
140 base: 'SauceLabs',
141 browserName: 'android',
142 platform:'Linux'
143 }
144
145 }
146
147 });
148 };
1 // Karma example configuration file
2 // NOTE: To configure Karma tests, do the following:
3 // 1. Copy this file and rename the copy with a .conf.js extension, for example: karma.conf.js
4 // 2. Configure the properties below in your conf.js copy
5 // 3. Run your tests
6
7 module.exports = function(config) {
8 config.set({
9 // base path, that will be used to resolve files and exclude
10 basePath: '',
11
12 frameworks: ['qunit'],
13
14 // Set autoWatch to true if you plan to run `grunt karma` continuously, to automatically test changes as you make them.
15 autoWatch: false,
16
17 // Setting singleRun to true here will start up your specified browsers, run tests, and then shut down the browsers. Helpful to have in a CI environment, where you don't want to leave browsers running continuously.
18 singleRun: true,
19
20 // Start these browsers, currently available:
21 // - Chrome
22 // - ChromeCanary
23 // - Firefox
24 // - Opera
25 // - Safari (only Mac)
26 // - PhantomJS
27 // - IE (only Windows)
28 // Example usage:
29 // browsers: [],
30 // List of files / patterns to load in the browser
31 // Add any new src files to this list.
32 // If you add new unit tests, they will be picked up automatically by Karma,
33 // unless you've added them to a nested directory, in which case you should
34 // add their paths to this list.
35
36 files: [
37 '../node_modules/video.js/dist/video-js/video.js',
38 '../node_modules/videojs-contrib-media-sources/videojs-media-sources.js',
39 '../test/karma-qunit-shim.js',
40 "../src/videojs-hls.js",
41 "../src/flv-tag.js",
42 "../src/exp-golomb.js",
43 "../src/h264-stream.js",
44 "../src/aac-stream.js",
45 "../src/segment-parser.js",
46 "../src/stream.js",
47 "../src/m3u8/m3u8-parser.js",
48 "../tmp/manifests.js",
49 "../tmp/expected.js",
50 "tsSegment-bc.js",
51 "../src/bin-utils.js",
52 "../src/async-queue.js",
53 '../test/*.js'
54 ],
55
56 plugins: [
57 'karma-qunit',
58 'karma-chrome-launcher',
59 'karma-firefox-launcher',
60 'karma-ie-launcher',
61 'karma-opera-launcher',
62 'karma-phantomjs-launcher',
63 'karma-safari-launcher'
64 ],
65
66 // list of files to exclude
67 exclude: [
68
69 ],
70
71
72 // test results reporter to use
73 // possible values: 'dots', 'progress', 'junit'
74 reporters: ['progress'],
75
76
77 // web server port
78 port: 9876,
79
80
81 // cli runner port
82 runnerPort: 9100,
83
84
85 // enable / disable colors in the output (reporters and logs)
86 colors: true,
87
88
89 // level of logging
90 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
91 //logLevel: config.LOG_INFO,
92
93 // If browser does not capture in given timeout [ms], kill it
94 captureTimeout: 60000
95 });
96 };
...\ No newline at end of file ...\ No newline at end of file