aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--.travis.yml1
-rw-r--r--server/tests/api/utils.js25
3 files changed, 18 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index a79cc6a97..debe118e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@ public/stylesheets/vendor
13uploads 13uploads
14thumbnails 14thumbnails
15config/production.yaml 15config/production.yaml
16ffmpeg
diff --git a/.travis.yml b/.travis.yml
index cb351c613..e6a92d883 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -27,6 +27,7 @@ before_script:
27 - mkdir -p $HOME/bin 27 - mkdir -p $HOME/bin
28 - cp ffmpeg-*-64bit-static/{ffmpeg,ffprobe,ffserver} $HOME/bin 28 - cp ffmpeg-*-64bit-static/{ffmpeg,ffprobe,ffserver} $HOME/bin
29 - export PATH=$HOME/bin:$PATH 29 - export PATH=$HOME/bin:$PATH
30 - export NODE_TEST_IMAGE=true
30 31
31after_failure: 32after_failure:
32 - cat test1/logs/all-logs.log 33 - cat test1/logs/all-logs.log
diff --git a/server/tests/api/utils.js b/server/tests/api/utils.js
index 7c8698a0a..314269b5c 100644
--- a/server/tests/api/utils.js
+++ b/server/tests/api/utils.js
@@ -350,18 +350,25 @@ function searchVideoWithSort (url, search, sort, end) {
350} 350}
351 351
352function testImage (url, videoName, imagePath, callback) { 352function testImage (url, videoName, imagePath, callback) {
353 request(url) 353 // Don't test images if the node env is not set
354 .get(imagePath) 354 // Because we need a special ffmpeg version for this test
355 .expect(200) 355 if (process.env.NODE_TEST_IMAGE) {
356 .end(function (err, res) { 356 request(url)
357 if (err) return callback(err) 357 .get(imagePath)
358 358 .expect(200)
359 fs.readFile(pathUtils.join(__dirname, 'fixtures', videoName + '.jpg'), function (err, data) { 359 .end(function (err, res) {
360 if (err) return callback(err) 360 if (err) return callback(err)
361 361
362 callback(null, data.equals(res.body)) 362 fs.readFile(pathUtils.join(__dirname, 'fixtures', videoName + '.jpg'), function (err, data) {
363 if (err) return callback(err)
364
365 callback(null, data.equals(res.body))
366 })
363 }) 367 })
364 }) 368 } else {
369 console.log('Do not test images. Enable it by setting NODE_TEST_IMAGE env variable.')
370 callback(null, true)
371 }
365} 372}
366 373
367function uploadVideo (url, accessToken, name, description, tags, fixture, specialStatus, end) { 374function uploadVideo (url, accessToken, name, description, tags, fixture, specialStatus, end) {