diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-07-20 17:53:39 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-07-20 17:55:26 +0200 |
commit | 2bd3f171270aff9717a55f2b89757fe966911af3 (patch) | |
tree | 12bc67c29b152100368f481fa8938fa82878b6a4 | |
parent | 0f3a78e7eafa000864f5d9348565d33aedc707e1 (diff) | |
download | PeerTube-2bd3f171270aff9717a55f2b89757fe966911af3.tar.gz PeerTube-2bd3f171270aff9717a55f2b89757fe966911af3.tar.zst PeerTube-2bd3f171270aff9717a55f2b89757fe966911af3.zip |
Server: do not enable images tests by default because it needs a special
ffmpeg version
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | .travis.yml | 1 | ||||
-rw-r--r-- | server/tests/api/utils.js | 25 |
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 | |||
13 | uploads | 13 | uploads |
14 | thumbnails | 14 | thumbnails |
15 | config/production.yaml | 15 | config/production.yaml |
16 | ffmpeg | ||
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 | ||
31 | after_failure: | 32 | after_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 | ||
352 | function testImage (url, videoName, imagePath, callback) { | 352 | function 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 | ||
367 | function uploadVideo (url, accessToken, name, description, tags, fixture, specialStatus, end) { | 374 | function uploadVideo (url, accessToken, name, description, tags, fixture, specialStatus, end) { |