From b488ba1e26b803ac6c637e8b11bdd444ca4c803f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 30 Jul 2020 09:43:12 +0200 Subject: Don't rely on youtube for tests Use another import URL when possible, and disable import tests when we want to do a youtube import test --- shared/extra-utils/miscs/miscs.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'shared/extra-utils/miscs') diff --git a/shared/extra-utils/miscs/miscs.ts b/shared/extra-utils/miscs/miscs.ts index 2239d5bcc..caf09c01f 100644 --- a/shared/extra-utils/miscs/miscs.ts +++ b/shared/extra-utils/miscs/miscs.ts @@ -64,19 +64,25 @@ async function testImage (url: string, imageName: string, imagePath: string, ext } function buildAbsoluteFixturePath (path: string, customCIPath = false) { - if (isAbsolute(path)) { - return path - } + if (isAbsolute(path)) return path if (customCIPath) { if (process.env.GITLAB_CI) return join(root(), 'cached-fixtures', path) - if (process.env.TRAVIS) return join(process.env.HOME, 'fixtures', path) + return join(process.env.HOME, 'fixtures', path) } return join(root(), 'server', 'tests', 'fixtures', path) } +function areHttpImportTestsDisabled () { + const disabled = process.env.DISABLE_HTTP_IMPORT_TESTS === 'true' + + if (disabled) console.log('Import tests are disabled') + + return disabled +} + async function generateHighBitrateVideo () { const tempFixturePath = buildAbsoluteFixturePath('video_high_bitrate_1080p.mp4', true) @@ -131,6 +137,7 @@ async function generateVideoWithFramerate (fps = 60) { export { dateIsValid, wait, + areHttpImportTestsDisabled, buildServerDirectory, webtorrentAdd, immutableAssign, -- cgit v1.2.3