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 /server/tests/api/utils.js | |
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
Diffstat (limited to 'server/tests/api/utils.js')
-rw-r--r-- | server/tests/api/utils.js | 25 |
1 files changed, 16 insertions, 9 deletions
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) { |