]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/miscs/miscs.ts
Comment changed, mostly to kick Travis into rectifying its last silliness
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / miscs / miscs.ts
index 08f41a7e7503ef564fb0d69d35bd9787dc3e3b0e..6b0f6d990a940164b708884c097934a12d3bce98 100644 (file)
@@ -44,6 +44,10 @@ function root () {
   return root
 }
 
+function buildServerDirectory (internalServerNumber: number, directory: string) {
+  return join(root(), 'test' + internalServerNumber, directory)
+}
+
 async function testImage (url: string, imageName: string, imagePath: string, extension = '.jpg') {
   const res = await request(url)
     .get(imagePath)
@@ -64,7 +68,11 @@ function buildAbsoluteFixturePath (path: string, customCIPath = false) {
     return path
   }
 
-  if (customCIPath && process.env.GITLAB_CI) return join(root(), 'cached-fixtures', 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(root(), 'server', 'tests', 'fixtures', path)
 }
@@ -101,6 +109,7 @@ async function generateHighBitrateVideo () {
 export {
   dateIsValid,
   wait,
+  buildServerDirectory,
   webtorrentAdd,
   immutableAssign,
   testImage,