Skip to content

Commit e13ddbe

Browse files
author
Nicolas Joyard
committed
Update travis config to run on containers
1 parent fd86ee1 commit e13ddbe

File tree

5 files changed

+79
-73
lines changed

5 files changed

+79
-73
lines changed

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,11 @@ matrix:
66
env: NODE_VERSION=0.12
77
script:
88
- tools/test-travis.sh
9+
sudo: false
10+
addons:
11+
apt:
12+
packages:
13+
- wget
14+
- tar
15+
- bzip2
16+
- flvtool2

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
"devDependencies": {
2222
"mocha": "latest",
2323
"should": "latest",
24-
"grunt-contrib-watch": "~0.4.4",
25-
"grunt-shell": "~0.3.0",
26-
"grunt": "~0.4.1",
2724
"jsdoc": "latest"
2825
},
2926
"dependencies": {

test/capabilities.test.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,12 @@ describe('Capabilities', function() {
498498
var FLVTOOL2_PATH;
499499
var ALT_FLVTOOL_PATH;
500500
var skipAltTest = false;
501+
var skipTest = false;
502+
503+
// Skip test if we know travis failed to instal flvtool2
504+
if (process.env.FLVTOOL2_PRESENT === 'no') {
505+
skipTest = true;
506+
}
501507

502508
// Only test with FLVTOOL2_PATH when we actually have an alternative path
503509
if (process.env.ALT_FLVTOOL_PATH) {
@@ -521,7 +527,7 @@ describe('Capabilities', function() {
521527
(new Ffmpeg())._forgetPaths();
522528
});
523529

524-
it('should allow manual definition of fflvtool binary path', function(done) {
530+
(skipTest ? it.skip : it)('should allow manual definition of fflvtool binary path', function(done) {
525531
var ff = new Ffmpeg();
526532

527533
ff.setFlvtoolPath('/doom/di/dom');
@@ -534,7 +540,7 @@ describe('Capabilities', function() {
534540
});
535541
});
536542

537-
it('should allow static manual definition of fflvtool binary path', function(done) {
543+
(skipTest ? it.skip : it)('should allow static manual definition of fflvtool binary path', function(done) {
538544
var ff = new Ffmpeg();
539545

540546
Ffmpeg.setFlvtoolPath('/doom/di/dom2');
@@ -547,7 +553,7 @@ describe('Capabilities', function() {
547553
});
548554
});
549555

550-
it('should look for fflvtool in the PATH if FLVTOOL2_PATH is not defined', function(done) {
556+
(skipTest ? it.skip : it)('should look for fflvtool in the PATH if FLVTOOL2_PATH is not defined', function(done) {
551557
var ff = new Ffmpeg();
552558

553559
delete process.env.FLVTOOL2_PATH;
@@ -566,7 +572,7 @@ describe('Capabilities', function() {
566572
});
567573
});
568574

569-
(skipAltTest ? it.skip : it)('should use FLVTOOL2_PATH if defined and valid', function(done) {
575+
(skipTest || skipAltTest ? it.skip : it)('should use FLVTOOL2_PATH if defined and valid', function(done) {
570576
var ff = new Ffmpeg();
571577

572578
process.env.FLVTOOL2_PATH = ALT_FLVTOOL_PATH;
@@ -581,7 +587,7 @@ describe('Capabilities', function() {
581587
});
582588
});
583589

584-
it('should fall back to searching in the PATH if FLVTOOL2_PATH is invalid', function(done) {
590+
(skipTest ? it.skip : it)('should fall back to searching in the PATH if FLVTOOL2_PATH is invalid', function(done) {
585591
var ff = new Ffmpeg();
586592

587593
process.env.FLVTOOL2_PATH = '/nope/not-here/nothing-to-see-here';
@@ -600,7 +606,7 @@ describe('Capabilities', function() {
600606
});
601607
});
602608

603-
it('should remember fflvtool path', function(done) {
609+
(skipTest ? it.skip : it)('should remember fflvtool path', function(done) {
604610
var ff = new Ffmpeg();
605611

606612
delete process.env.FLVTOOL2_PATH;

test/processor.test.js

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ describe('Processor', function() {
194194
((skipNiceness || skipRenice) ? it.skip : it)('should dynamically renice process', function(done) {
195195
this.timeout(60000);
196196

197-
var testFile = path.join(__dirname, 'assets', 'testProcessRenice.flv');
197+
var testFile = path.join(__dirname, 'assets', 'testProcessRenice.avi');
198198
this.files.push(testFile);
199199

200200
var ffmpegJob = this.getCommand({ source: this.testfilebig, logger: testhelper.logger, timeout: 2 })
201-
.usingPreset('flashvideo');
201+
.usingPreset('divx');
202202

203203
var startCalled = false;
204204
var reniced = false;
@@ -236,11 +236,11 @@ describe('Processor', function() {
236236
});
237237

238238
it('should change the working directory', function(done) {
239-
var testFile = path.join(this.testdir, 'testvideo.flv');
239+
var testFile = path.join(this.testdir, 'testvideo.avi');
240240
this.files.push(testFile);
241241

242242
this.getCommand({ source: this.testfileName, logger: testhelper.logger, cwd: this.testdir })
243-
.usingPreset('flashvideo')
243+
.usingPreset('divx')
244244
.on('error', function(err, stdout, stderr) {
245245
testhelper.logError(err, stdout, stderr);
246246
assert.ok(!err);
@@ -252,14 +252,14 @@ describe('Processor', function() {
252252
});
253253

254254
it('should kill the process on timeout', function(done) {
255-
var testFile = path.join(__dirname, 'assets', 'testProcessKillTimeout.flv');
255+
var testFile = path.join(__dirname, 'assets', 'testProcessKillTimeout.avi');
256256
this.files.push(testFile);
257257

258258
var command = this.getCommand({ source: this.testfilebig, logger: testhelper.logger, timeout: 0.02});
259259
var self = this;
260260

261261
command
262-
.usingPreset('flashvideo')
262+
.usingPreset('divx')
263263
.on('start', function() {
264264
command.ffmpegProc.on('exit', function() {
265265
done();
@@ -278,11 +278,11 @@ describe('Processor', function() {
278278
});
279279

280280
it('should kill the process with .kill', function(done) {
281-
var testFile = path.join(__dirname, 'assets', 'testProcessKill.flv');
281+
var testFile = path.join(__dirname, 'assets', 'testProcessKill.avi');
282282
this.files.push(testFile);
283283

284284
var ffmpegJob = this.getCommand({ source: this.testfilebig, logger: testhelper.logger })
285-
.usingPreset('flashvideo');
285+
.usingPreset('divx');
286286

287287
var startCalled = false;
288288
var errorCalled = false;
@@ -312,11 +312,11 @@ describe('Processor', function() {
312312
it('should send the process custom signals with .kill(signal)', function(done) {
313313
this.timeout(60000);
314314

315-
var testFile = path.join(__dirname, 'assets', 'testProcessKillCustom.flv');
315+
var testFile = path.join(__dirname, 'assets', 'testProcessKillCustom.avi');
316316
this.files.push(testFile);
317317

318318
var ffmpegJob = this.getCommand({ source: this.testfilebig, logger: testhelper.logger, timeout: 2 })
319-
.usingPreset('flashvideo');
319+
.usingPreset('divx');
320320

321321
var startCalled = true;
322322
var errorCalled = false;
@@ -352,15 +352,15 @@ describe('Processor', function() {
352352
it('should report codec data through \'codecData\' event', function(done) {
353353
this.timeout(60000);
354354

355-
var testFile = path.join(__dirname, 'assets', 'testOnCodecData.flv');
355+
var testFile = path.join(__dirname, 'assets', 'testOnCodecData.avi');
356356
this.files.push(testFile);
357357

358358
this.getCommand({ source: this.testfilebig, logger: testhelper.logger })
359359
.on('codecData', function(data) {
360360
data.should.have.property('audio');
361361
data.should.have.property('video');
362362
})
363-
.usingPreset('flashvideo')
363+
.usingPreset('divx')
364364
.on('error', function(err, stdout, stderr) {
365365
testhelper.logError(err, stdout, stderr);
366366
assert.ok(!err);
@@ -374,7 +374,7 @@ describe('Processor', function() {
374374
it('should report progress through \'progress\' event', function(done) {
375375
this.timeout(60000);
376376

377-
var testFile = path.join(__dirname, 'assets', 'testOnProgress.flv');
377+
var testFile = path.join(__dirname, 'assets', 'testOnProgress.avi');
378378
var gotProgress = false;
379379

380380
this.files.push(testFile);
@@ -383,7 +383,7 @@ describe('Processor', function() {
383383
.on('progress', function() {
384384
gotProgress = true;
385385
})
386-
.usingPreset('flashvideo')
386+
.usingPreset('divx')
387387
.on('error', function(err, stdout, stderr) {
388388
testhelper.logError(err, stdout, stderr);
389389
assert.ok(!err);
@@ -398,7 +398,7 @@ describe('Processor', function() {
398398
it('should report start of ffmpeg process through \'start\' event', function(done) {
399399
this.timeout(60000);
400400

401-
var testFile = path.join(__dirname, 'assets', 'testStart.flv');
401+
var testFile = path.join(__dirname, 'assets', 'testStart.avi');
402402
var startCalled = false;
403403

404404
this.files.push(testFile);
@@ -410,9 +410,9 @@ describe('Processor', function() {
410410
// Only test a subset of command line
411411
cmdline.indexOf('ffmpeg').should.equal(0);
412412
cmdline.indexOf('testvideo-5m').should.not.equal(-1);
413-
cmdline.indexOf('-b:a 96k').should.not.equal(-1);
413+
cmdline.indexOf('-b:a 128k').should.not.equal(-1);
414414
})
415-
.usingPreset('flashvideo')
415+
.usingPreset('divx')
416416
.on('error', function(err, stdout, stderr) {
417417
testhelper.logError(err, stdout, stderr);
418418
assert.ok(!err);
@@ -577,11 +577,11 @@ describe('Processor', function() {
577577

578578
describe('saveToFile', function() {
579579
it('should save the output file properly to disk', function(done) {
580-
var testFile = path.join(__dirname, 'assets', 'testConvertToFile.flv');
580+
var testFile = path.join(__dirname, 'assets', 'testConvertToFile.avi');
581581
this.files.push(testFile);
582582

583583
this.getCommand({ source: this.testfile, logger: testhelper.logger })
584-
.usingPreset('flashvideo')
584+
.usingPreset('divx')
585585
.on('error', function(err, stdout, stderr) {
586586
testhelper.logError(err, stdout, stderr);
587587
assert.ok(!err);
@@ -604,11 +604,11 @@ describe('Processor', function() {
604604
});
605605

606606
it('should save an output file with special characters properly to disk', function(done) {
607-
var testFile = path.join(__dirname, 'assets', 'te[s]t video \' " .flv');
607+
var testFile = path.join(__dirname, 'assets', 'te[s]t video \' " .avi');
608608
this.files.push(testFile);
609609

610610
this.getCommand({ source: this.testfile, logger: testhelper.logger })
611-
.usingPreset('flashvideo')
611+
.usingPreset('divx')
612612
.on('error', function(err, stdout, stderr) {
613613
testhelper.logError(err, stdout, stderr);
614614
assert.ok(!err);
@@ -620,11 +620,11 @@ describe('Processor', function() {
620620
});
621621

622622
it('should save output files with special characters', function(done) {
623-
var testFile = path.join(__dirname, 'assets', '[test "special \' char*cters \n.flv');
623+
var testFile = path.join(__dirname, 'assets', '[test "special \' char*cters \n.avi');
624624
this.files.push(testFile);
625625

626626
this.getCommand({ source: this.testfile, logger: testhelper.logger })
627-
.usingPreset('flashvideo')
627+
.usingPreset('divx')
628628
.on('error', function(err, stdout, stderr) {
629629
testhelper.logError(err, stdout, stderr);
630630
assert.ok(!err);
@@ -646,12 +646,12 @@ describe('Processor', function() {
646646
});
647647

648648
it('should accept a stream as its source', function(done) {
649-
var testFile = path.join(__dirname, 'assets', 'testConvertFromStreamToFile.flv');
649+
var testFile = path.join(__dirname, 'assets', 'testConvertFromStreamToFile.avi');
650650
this.files.push(testFile);
651651

652652
var instream = fs.createReadStream(this.testfile);
653653
this.getCommand({ source: instream, logger: testhelper.logger })
654-
.usingPreset('flashvideo')
654+
.usingPreset('divx')
655655
.on('error', function(err, stdout, stderr) {
656656
testhelper.logError(err, stdout, stderr);
657657
assert.ok(!err);
@@ -705,12 +705,12 @@ describe('Processor', function() {
705705

706706
describe('writeToStream', function() {
707707
it('should save the output file properly to disk using a stream', function(done) {
708-
var testFile = path.join(__dirname, 'assets', 'testConvertToStream.flv');
708+
var testFile = path.join(__dirname, 'assets', 'testConvertToStream.avi');
709709
this.files.push(testFile);
710710

711711
var outstream = fs.createWriteStream(testFile);
712712
this.getCommand({ source: this.testfile, logger: testhelper.logger })
713-
.usingPreset('flashvideo')
713+
.usingPreset('divx')
714714
.on('error', function(err, stdout, stderr) {
715715
testhelper.logError(err, stdout, stderr);
716716
assert.ok(!err);
@@ -737,14 +737,14 @@ describe('Processor', function() {
737737
});
738738

739739
it('should accept a stream as its source', function(done) {
740-
var testFile = path.join(__dirname, 'assets', 'testConvertFromStreamToStream.flv');
740+
var testFile = path.join(__dirname, 'assets', 'testConvertFromStreamToStream.avi');
741741
this.files.push(testFile);
742742

743743
var instream = fs.createReadStream(this.testfile);
744744
var outstream = fs.createWriteStream(testFile);
745745

746746
this.getCommand({ source: instream, logger: testhelper.logger })
747-
.usingPreset('flashvideo')
747+
.usingPreset('divx')
748748
.on('error', function(err, stdout, stderr) {
749749
testhelper.logError(err, stdout, stderr);
750750
assert.ok(!err);
@@ -770,14 +770,14 @@ describe('Processor', function() {
770770
});
771771

772772
(process.version.match(/v0\.8\./) ? it.skip : it)('should return a PassThrough stream when called with no arguments on node >=0.10', function(done) {
773-
var testFile = path.join(__dirname, 'assets', 'testConvertToStream.flv');
773+
var testFile = path.join(__dirname, 'assets', 'testConvertToStream.avi');
774774
this.files.push(testFile);
775775

776776
var outstream = fs.createWriteStream(testFile);
777777
var command = this.getCommand({ source: this.testfile, logger: testhelper.logger });
778778

779779
command
780-
.usingPreset('flashvideo')
780+
.usingPreset('divx')
781781
.on('error', function(err, stdout, stderr) {
782782
testhelper.logError(err, stdout, stderr);
783783
assert.ok(!err);
@@ -870,12 +870,12 @@ describe('Processor', function() {
870870

871871
describe('Inputs', function() {
872872
it('should take input from a file with special characters', function(done) {
873-
var testFile = path.join(__dirname, 'assets', 'testSpecialInput.flv');
873+
var testFile = path.join(__dirname, 'assets', 'testSpecialInput.avi');
874874
this.files.push(testFile);
875875

876876
this.getCommand({ source: this.testfilespecial, logger: testhelper.logger, timeout: 10 })
877877
.takeFrames(50)
878-
.usingPreset('flashvideo')
878+
.usingPreset('divx')
879879
.on('error', function(err, stdout, stderr) {
880880
testhelper.logError(err, stdout, stderr);
881881
assert.ok(!err);
@@ -897,7 +897,7 @@ describe('Processor', function() {
897897
});
898898
});
899899

900-
describe('Remote I/O', function() {
900+
describe.skip('Remote I/O', function() {
901901
this.timeout(60000);
902902

903903
var ffserver;
@@ -944,12 +944,12 @@ describe('Processor', function() {
944944
});
945945

946946
it('should take input from a RTSP stream', function(done) {
947-
var testFile = path.join(__dirname, 'assets', 'testRTSPInput.flv');
947+
var testFile = path.join(__dirname, 'assets', 'testRTSPInput.avi');
948948
this.files.push(testFile);
949949

950950
this.getCommand({ source: encodeURI(testRTSP), logger: testhelper.logger, timeout: 0 })
951951
.takeFrames(10)
952-
.usingPreset('flashvideo')
952+
.usingPreset('divx')
953953
.withSize('320x240')
954954
.on('error', function(err, stdout, stderr) {
955955
testhelper.logError(err, stdout, stderr);
@@ -972,12 +972,12 @@ describe('Processor', function() {
972972
});
973973

974974
it('should take input from an URL', function(done) {
975-
var testFile = path.join(__dirname, 'assets', 'testURLInput.flv');
975+
var testFile = path.join(__dirname, 'assets', 'testURLInput.avi');
976976
this.files.push(testFile);
977977

978978
this.getCommand({ source: testHTTP, logger: testhelper.logger, timeout: 0 })
979979
.takeFrames(5)
980-
.usingPreset('flashvideo')
980+
.usingPreset('divx')
981981
.withSize('320x240')
982982
.on('error', function(err, stdout, stderr) {
983983
testhelper.logError(err, stdout, stderr);
@@ -1018,13 +1018,13 @@ describe('Processor', function() {
10181018
it('should report an error when ffmpeg has been killed', function(done) {
10191019
this.timeout(10000);
10201020

1021-
var testFile = path.join(__dirname, 'assets', 'testErrorKill.flv');
1021+
var testFile = path.join(__dirname, 'assets', 'testErrorKill.avi');
10221022
this.files.push(testFile);
10231023

10241024
var command = this.getCommand({ source: this.testfilebig, logger: testhelper.logger });
10251025

10261026
command
1027-
.usingPreset('flashvideo')
1027+
.usingPreset('divx')
10281028
.on('start', function() {
10291029
setTimeout(function() {
10301030
command.kill('SIGKILL');

0 commit comments

Comments
 (0)