]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/miscs/miscs.ts
Add max lives limit
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / miscs / miscs.ts
index 2239d5bccf99a7ed5d3ff82304d19c3dd4ffd1c2..dfd6e28cbeb6809ecb6cdc8b0d4218838b5b15bc 100644 (file)
@@ -64,19 +64,23 @@ async function testImage (url: string, imageName: string, imagePath: string, ext
 }
 
 function buildAbsoluteFixturePath (path: string, customCIPath = false) {
-  if (isAbsolute(path)) {
-    return path
-  }
-
-  if (customCIPath) {
-    if (process.env.GITLAB_CI) return join(root(), 'cached-fixtures', path)
+  if (isAbsolute(path)) return path
 
-    if (process.env.TRAVIS) return join(process.env.HOME, 'fixtures', path)
+  if (customCIPath && process.env.GITHUB_WORKSPACE) {
+    return join(process.env.GITHUB_WORKSPACE, '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 +135,7 @@ async function generateVideoWithFramerate (fps = 60) {
 export {
   dateIsValid,
   wait,
+  areHttpImportTestsDisabled,
   buildServerDirectory,
   webtorrentAdd,
   immutableAssign,