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
This commit is contained in:
Chocobozzz
2020-07-30 09:43:12 +02:00
committed by Chocobozzz
parent b9fe9a7ffd
commit b488ba1e26
10 changed files with 64 additions and 49 deletions

View File

@@ -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,