diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-05 16:37:50 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:16 +0200 |
commit | 329619b3453479f76c049816b7403b86e9d45cb5 (patch) | |
tree | e522940946402a4284d356f2cde8e0dcbe29b289 /server/tests/cli/create-transcoding-job.ts | |
parent | a6a79eae0d8564099b6957e76d7a18528d9ef124 (diff) | |
download | PeerTube-329619b3453479f76c049816b7403b86e9d45cb5.tar.gz PeerTube-329619b3453479f76c049816b7403b86e9d45cb5.tar.zst PeerTube-329619b3453479f76c049816b7403b86e9d45cb5.zip |
Introduce CLI command
Diffstat (limited to 'server/tests/cli/create-transcoding-job.ts')
-rw-r--r-- | server/tests/cli/create-transcoding-job.ts | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/server/tests/cli/create-transcoding-job.ts b/server/tests/cli/create-transcoding-job.ts index 5bc1687cd..be46dec25 100644 --- a/server/tests/cli/create-transcoding-job.ts +++ b/server/tests/cli/create-transcoding-job.ts | |||
@@ -2,13 +2,10 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { VideoDetails } from '../../../shared/models/videos' | ||
6 | import { | 5 | import { |
7 | cleanupTests, | 6 | cleanupTests, |
8 | doubleFollow, | 7 | doubleFollow, |
9 | execCLI, | ||
10 | flushAndRunMultipleServers, | 8 | flushAndRunMultipleServers, |
11 | getEnvCli, | ||
12 | getVideo, | 9 | getVideo, |
13 | getVideosList, | 10 | getVideosList, |
14 | ServerInfo, | 11 | ServerInfo, |
@@ -17,6 +14,7 @@ import { | |||
17 | uploadVideo | 14 | uploadVideo |
18 | } from '../../../shared/extra-utils' | 15 | } from '../../../shared/extra-utils' |
19 | import { waitJobs } from '../../../shared/extra-utils/server/jobs' | 16 | import { waitJobs } from '../../../shared/extra-utils/server/jobs' |
17 | import { VideoDetails } from '../../../shared/models/videos' | ||
20 | 18 | ||
21 | const expect = chai.expect | 19 | const expect = chai.expect |
22 | 20 | ||
@@ -81,9 +79,7 @@ describe('Test create transcoding jobs', function () { | |||
81 | it('Should run a transcoding job on video 2', async function () { | 79 | it('Should run a transcoding job on video 2', async function () { |
82 | this.timeout(60000) | 80 | this.timeout(60000) |
83 | 81 | ||
84 | const env = getEnvCli(servers[0]) | 82 | await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[1]}`) |
85 | await execCLI(`${env} npm run create-transcoding-job -- -v ${videosUUID[1]}`) | ||
86 | |||
87 | await waitJobs(servers) | 83 | await waitJobs(servers) |
88 | 84 | ||
89 | for (const server of servers) { | 85 | for (const server of servers) { |
@@ -123,8 +119,7 @@ describe('Test create transcoding jobs', function () { | |||
123 | it('Should run a transcoding job on video 1 with resolution', async function () { | 119 | it('Should run a transcoding job on video 1 with resolution', async function () { |
124 | this.timeout(60000) | 120 | this.timeout(60000) |
125 | 121 | ||
126 | const env = getEnvCli(servers[0]) | 122 | await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[0]} -r 480`) |
127 | await execCLI(`${env} npm run create-transcoding-job -- -v ${videosUUID[0]} -r 480`) | ||
128 | 123 | ||
129 | await waitJobs(servers) | 124 | await waitJobs(servers) |
130 | 125 | ||
@@ -147,8 +142,7 @@ describe('Test create transcoding jobs', function () { | |||
147 | it('Should generate an HLS resolution', async function () { | 142 | it('Should generate an HLS resolution', async function () { |
148 | this.timeout(120000) | 143 | this.timeout(120000) |
149 | 144 | ||
150 | const env = getEnvCli(servers[0]) | 145 | await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[2]} --generate-hls -r 480`) |
151 | await execCLI(`${env} npm run create-transcoding-job -- -v ${videosUUID[2]} --generate-hls -r 480`) | ||
152 | 146 | ||
153 | await waitJobs(servers) | 147 | await waitJobs(servers) |
154 | 148 | ||
@@ -168,8 +162,7 @@ describe('Test create transcoding jobs', function () { | |||
168 | it('Should not duplicate an HLS resolution', async function () { | 162 | it('Should not duplicate an HLS resolution', async function () { |
169 | this.timeout(120000) | 163 | this.timeout(120000) |
170 | 164 | ||
171 | const env = getEnvCli(servers[0]) | 165 | await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[2]} --generate-hls -r 480`) |
172 | await execCLI(`${env} npm run create-transcoding-job -- -v ${videosUUID[2]} --generate-hls -r 480`) | ||
173 | 166 | ||
174 | await waitJobs(servers) | 167 | await waitJobs(servers) |
175 | 168 | ||
@@ -186,8 +179,7 @@ describe('Test create transcoding jobs', function () { | |||
186 | it('Should generate all HLS resolutions', async function () { | 179 | it('Should generate all HLS resolutions', async function () { |
187 | this.timeout(120000) | 180 | this.timeout(120000) |
188 | 181 | ||
189 | const env = getEnvCli(servers[0]) | 182 | await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[3]} --generate-hls`) |
190 | await execCLI(`${env} npm run create-transcoding-job -- -v ${videosUUID[3]} --generate-hls`) | ||
191 | 183 | ||
192 | await waitJobs(servers) | 184 | await waitJobs(servers) |
193 | 185 | ||
@@ -209,8 +201,7 @@ describe('Test create transcoding jobs', function () { | |||
209 | config.transcoding.hls.enabled = true | 201 | config.transcoding.hls.enabled = true |
210 | await updateCustomSubConfig(servers[0].url, servers[0].accessToken, config) | 202 | await updateCustomSubConfig(servers[0].url, servers[0].accessToken, config) |
211 | 203 | ||
212 | const env = getEnvCli(servers[0]) | 204 | await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[4]}`) |
213 | await execCLI(`${env} npm run create-transcoding-job -- -v ${videosUUID[4]}`) | ||
214 | 205 | ||
215 | await waitJobs(servers) | 206 | await waitJobs(servers) |
216 | 207 | ||