diff options
Diffstat (limited to 'shared/extra-utils/miscs/miscs.ts')
-rw-r--r-- | shared/extra-utils/miscs/miscs.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/shared/extra-utils/miscs/miscs.ts b/shared/extra-utils/miscs/miscs.ts index 42250886c..08f41a7e7 100644 --- a/shared/extra-utils/miscs/miscs.ts +++ b/shared/extra-utils/miscs/miscs.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | /* tslint:disable:no-unused-expression */ | 1 | /* tslint:disable:no-unused-expression */ |
2 | 2 | ||
3 | import * as chai from 'chai' | 3 | import * as chai from 'chai' |
4 | import { basename, isAbsolute, join, resolve } from 'path' | 4 | import { basename, dirname, isAbsolute, join, resolve } from 'path' |
5 | import * as request from 'supertest' | 5 | import * as request from 'supertest' |
6 | import * as WebTorrent from 'webtorrent' | 6 | import * as WebTorrent from 'webtorrent' |
7 | import { pathExists, readFile } from 'fs-extra' | 7 | import { ensureDir, pathExists, readFile } from 'fs-extra' |
8 | import * as ffmpeg from 'fluent-ffmpeg' | 8 | import * as ffmpeg from 'fluent-ffmpeg' |
9 | 9 | ||
10 | const expect = chai.expect | 10 | const expect = chai.expect |
@@ -59,12 +59,12 @@ async function testImage (url: string, imageName: string, imagePath: string, ext | |||
59 | expect(data.length).to.be.below(maxLength) | 59 | expect(data.length).to.be.below(maxLength) |
60 | } | 60 | } |
61 | 61 | ||
62 | function buildAbsoluteFixturePath (path: string, customTravisPath = false) { | 62 | function buildAbsoluteFixturePath (path: string, customCIPath = false) { |
63 | if (isAbsolute(path)) { | 63 | if (isAbsolute(path)) { |
64 | return path | 64 | return path |
65 | } | 65 | } |
66 | 66 | ||
67 | if (customTravisPath && process.env.TRAVIS) return join(process.env.HOME, 'fixtures', path) | 67 | if (customCIPath && process.env.GITLAB_CI) return join(root(), 'cached-fixtures', path) |
68 | 68 | ||
69 | return join(root(), 'server', 'tests', 'fixtures', path) | 69 | return join(root(), 'server', 'tests', 'fixtures', path) |
70 | } | 70 | } |
@@ -72,6 +72,8 @@ function buildAbsoluteFixturePath (path: string, customTravisPath = false) { | |||
72 | async function generateHighBitrateVideo () { | 72 | async function generateHighBitrateVideo () { |
73 | const tempFixturePath = buildAbsoluteFixturePath('video_high_bitrate_1080p.mp4', true) | 73 | const tempFixturePath = buildAbsoluteFixturePath('video_high_bitrate_1080p.mp4', true) |
74 | 74 | ||
75 | await ensureDir(dirname(tempFixturePath)) | ||
76 | |||
75 | const exists = await pathExists(tempFixturePath) | 77 | const exists = await pathExists(tempFixturePath) |
76 | if (!exists) { | 78 | if (!exists) { |
77 | 79 | ||