diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-16 09:04:35 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | 89d241a79c262b9775c233b73cff080043ebb5e6 (patch) | |
tree | cb3b6cb431d25d891ef4e02f66c61d252d17048f /server/tests/cli/optimize-old-videos.ts | |
parent | d23dd9fbfc4d26026352c10f81d2795ceaf2908a (diff) | |
download | PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.gz PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.zst PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.zip |
Shorter server command names
Diffstat (limited to 'server/tests/cli/optimize-old-videos.ts')
-rw-r--r-- | server/tests/cli/optimize-old-videos.ts | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/server/tests/cli/optimize-old-videos.ts b/server/tests/cli/optimize-old-videos.ts index ef8603a33..eefc95a6d 100644 --- a/server/tests/cli/optimize-old-videos.ts +++ b/server/tests/cli/optimize-old-videos.ts | |||
@@ -41,8 +41,8 @@ describe('Test optimize old videos', function () { | |||
41 | } | 41 | } |
42 | 42 | ||
43 | // Upload two videos for our needs | 43 | // Upload two videos for our needs |
44 | await servers[0].videosCommand.upload({ attributes: { name: 'video1', fixture: tempFixturePath } }) | 44 | await servers[0].videos.upload({ attributes: { name: 'video1', fixture: tempFixturePath } }) |
45 | await servers[0].videosCommand.upload({ attributes: { name: 'video2', fixture: tempFixturePath } }) | 45 | await servers[0].videos.upload({ attributes: { name: 'video2', fixture: tempFixturePath } }) |
46 | 46 | ||
47 | await waitJobs(servers) | 47 | await waitJobs(servers) |
48 | }) | 48 | }) |
@@ -51,11 +51,11 @@ describe('Test optimize old videos', function () { | |||
51 | this.timeout(30000) | 51 | this.timeout(30000) |
52 | 52 | ||
53 | for (const server of servers) { | 53 | for (const server of servers) { |
54 | const { data } = await server.videosCommand.list() | 54 | const { data } = await server.videos.list() |
55 | expect(data).to.have.lengthOf(2) | 55 | expect(data).to.have.lengthOf(2) |
56 | 56 | ||
57 | for (const video of data) { | 57 | for (const video of data) { |
58 | const videoDetails = await server.videosCommand.get({ id: video.uuid }) | 58 | const videoDetails = await server.videos.get({ id: video.uuid }) |
59 | expect(videoDetails.files).to.have.lengthOf(1) | 59 | expect(videoDetails.files).to.have.lengthOf(1) |
60 | } | 60 | } |
61 | } | 61 | } |
@@ -64,29 +64,29 @@ describe('Test optimize old videos', function () { | |||
64 | it('Should run optimize script', async function () { | 64 | it('Should run optimize script', async function () { |
65 | this.timeout(200000) | 65 | this.timeout(200000) |
66 | 66 | ||
67 | await servers[0].cliCommand.execWithEnv('npm run optimize-old-videos') | 67 | await servers[0].cli.execWithEnv('npm run optimize-old-videos') |
68 | await waitJobs(servers) | 68 | await waitJobs(servers) |
69 | 69 | ||
70 | for (const server of servers) { | 70 | for (const server of servers) { |
71 | const { data } = await server.videosCommand.list() | 71 | const { data } = await server.videos.list() |
72 | expect(data).to.have.lengthOf(2) | 72 | expect(data).to.have.lengthOf(2) |
73 | 73 | ||
74 | for (const video of data) { | 74 | for (const video of data) { |
75 | await server.videosCommand.view({ id: video.uuid }) | 75 | await server.videos.view({ id: video.uuid }) |
76 | 76 | ||
77 | // Refresh video | 77 | // Refresh video |
78 | await waitJobs(servers) | 78 | await waitJobs(servers) |
79 | await wait(5000) | 79 | await wait(5000) |
80 | await waitJobs(servers) | 80 | await waitJobs(servers) |
81 | 81 | ||
82 | const videoDetails = await server.videosCommand.get({ id: video.uuid }) | 82 | const videoDetails = await server.videos.get({ id: video.uuid }) |
83 | 83 | ||
84 | expect(videoDetails.files).to.have.lengthOf(1) | 84 | expect(videoDetails.files).to.have.lengthOf(1) |
85 | const file = videoDetails.files[0] | 85 | const file = videoDetails.files[0] |
86 | 86 | ||
87 | expect(file.size).to.be.below(8000000) | 87 | expect(file.size).to.be.below(8000000) |
88 | 88 | ||
89 | const path = servers[0].serversCommand.buildDirectory(join('videos', video.uuid + '-' + file.resolution.id + '.mp4')) | 89 | const path = servers[0].servers.buildDirectory(join('videos', video.uuid + '-' + file.resolution.id + '.mp4')) |
90 | const bitrate = await getVideoFileBitrate(path) | 90 | const bitrate = await getVideoFileBitrate(path) |
91 | const fps = await getVideoFileFPS(path) | 91 | const fps = await getVideoFileFPS(path) |
92 | const resolution = await getVideoFileResolution(path) | 92 | const resolution = await getVideoFileResolution(path) |