]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/miscs/tests.ts
Add peertube import test
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / miscs / tests.ts
index 3dfb2487edf07449ea14ceab74876cd9f881dce1..5b543027816a6f0e94c9ab1582c296be24c44ae3 100644 (file)
@@ -2,6 +2,9 @@ import { stat } from 'fs-extra'
 import { basename, isAbsolute, join, resolve } from 'path'
 
 const FIXTURE_URLS = {
+  peertube_long: 'https://peertube2.cpy.re/videos/watch/122d093a-1ede-43bd-bd34-59d2931ffc5e',
+  peertube_short: 'https://peertube2.cpy.re/w/3fbif9S3WmtTP8gGsC5HBd',
+
   youtube: 'https://www.youtube.com/watch?v=msX3jv1XdvM',
 
   /**
@@ -28,7 +31,9 @@ const FIXTURE_URLS = {
 
   badVideo: 'https://download.cpy.re/peertube/bad_video.mp4',
   goodVideo: 'https://download.cpy.re/peertube/good_video.mp4',
-  video4K: 'https://download.cpy.re/peertube/4k_file.txt'
+  goodVideo720: 'https://download.cpy.re/peertube/good_video_720.mp4',
+
+  file4K: 'https://download.cpy.re/peertube/4k_file.txt'
 }
 
 function parallelTests () {
@@ -42,7 +47,15 @@ function isGithubCI () {
 function areHttpImportTestsDisabled () {
   const disabled = process.env.DISABLE_HTTP_IMPORT_TESTS === 'true'
 
-  if (disabled) console.log('Import tests are disabled')
+  if (disabled) console.log('DISABLE_HTTP_IMPORT_TESTS env set to "true" so import tests are disabled')
+
+  return disabled
+}
+
+function areObjectStorageTestsDisabled () {
+  const disabled = process.env.ENABLE_OBJECT_STORAGE_TESTS !== 'true'
+
+  if (disabled) console.log('ENABLE_OBJECT_STORAGE_TESTS env is not set to "true" so object storage tests are disabled')
 
   return disabled
 }
@@ -89,6 +102,7 @@ export {
   buildAbsoluteFixturePath,
   getFileSize,
   buildRequestStub,
+  areObjectStorageTestsDisabled,
   wait,
   root
 }