From 2bd3f171270aff9717a55f2b89757fe966911af3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 20 Jul 2016 17:53:39 +0200 Subject: Server: do not enable images tests by default because it needs a special ffmpeg version --- server/tests/api/utils.js | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'server/tests/api') 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) { } function testImage (url, videoName, imagePath, callback) { - request(url) - .get(imagePath) - .expect(200) - .end(function (err, res) { - if (err) return callback(err) - - fs.readFile(pathUtils.join(__dirname, 'fixtures', videoName + '.jpg'), function (err, data) { + // Don't test images if the node env is not set + // Because we need a special ffmpeg version for this test + if (process.env.NODE_TEST_IMAGE) { + request(url) + .get(imagePath) + .expect(200) + .end(function (err, res) { if (err) return callback(err) - callback(null, data.equals(res.body)) + fs.readFile(pathUtils.join(__dirname, 'fixtures', videoName + '.jpg'), function (err, data) { + if (err) return callback(err) + + callback(null, data.equals(res.body)) + }) }) - }) + } else { + console.log('Do not test images. Enable it by setting NODE_TEST_IMAGE env variable.') + callback(null, true) + } } function uploadVideo (url, accessToken, name, description, tags, fixture, specialStatus, end) { -- cgit v1.2.3