]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/cli/create-transcoding-job.ts
Shorter server command names
[github/Chocobozzz/PeerTube.git] / server / tests / cli / create-transcoding-job.ts
index f629306e65c6c93fa324d8309b62e897293964d5..c9bbab802bdf557afb706987f800c6ca2543bc33 100644 (file)
@@ -42,12 +42,12 @@ describe('Test create transcoding jobs', function () {
     servers = await flushAndRunMultipleServers(2)
     await setAccessTokensToServers(servers)
 
-    await servers[0].configCommand.updateCustomSubConfig({ newConfig: config })
+    await servers[0].config.updateCustomSubConfig({ newConfig: config })
 
     await doubleFollow(servers[0], servers[1])
 
     for (let i = 1; i <= 5; i++) {
-      const { uuid } = await servers[0].videosCommand.upload({ attributes: { name: 'video' + i } })
+      const { uuid } = await servers[0].videos.upload({ attributes: { name: 'video' + i } })
       videosUUID.push(uuid)
     }
 
@@ -58,11 +58,11 @@ describe('Test create transcoding jobs', function () {
     this.timeout(30000)
 
     for (const server of servers) {
-      const { data } = await server.videosCommand.list()
+      const { data } = await server.videos.list()
       expect(data).to.have.lengthOf(videosUUID.length)
 
       for (const video of data) {
-        const videoDetail = await server.videosCommand.get({ id: video.uuid })
+        const videoDetail = await server.videos.get({ id: video.uuid })
         expect(videoDetail.files).to.have.lengthOf(1)
         expect(videoDetail.streamingPlaylists).to.have.lengthOf(0)
       }
@@ -72,16 +72,16 @@ describe('Test create transcoding jobs', function () {
   it('Should run a transcoding job on video 2', async function () {
     this.timeout(60000)
 
-    await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[1]}`)
+    await servers[0].cli.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[1]}`)
     await waitJobs(servers)
 
     for (const server of servers) {
-      const { data } = await server.videosCommand.list()
+      const { data } = await server.videos.list()
 
       let infoHashes: { [id: number]: string }
 
       for (const video of data) {
-        const videoDetail = await server.videosCommand.get({ id: video.uuid })
+        const videoDetail = await server.videos.get({ id: video.uuid })
 
         if (video.uuid === videosUUID[1]) {
           expect(videoDetail.files).to.have.lengthOf(4)
@@ -110,15 +110,15 @@ describe('Test create transcoding jobs', function () {
   it('Should run a transcoding job on video 1 with resolution', async function () {
     this.timeout(60000)
 
-    await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[0]} -r 480`)
+    await servers[0].cli.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[0]} -r 480`)
 
     await waitJobs(servers)
 
     for (const server of servers) {
-      const { data } = await server.videosCommand.list()
+      const { data } = await server.videos.list()
       expect(data).to.have.lengthOf(videosUUID.length)
 
-      const videoDetails = await server.videosCommand.get({ id: videosUUID[0] })
+      const videoDetails = await server.videos.get({ id: videosUUID[0] })
 
       expect(videoDetails.files).to.have.lengthOf(2)
       expect(videoDetails.files[0].resolution.id).to.equal(720)
@@ -131,12 +131,12 @@ describe('Test create transcoding jobs', function () {
   it('Should generate an HLS resolution', async function () {
     this.timeout(120000)
 
-    await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[2]} --generate-hls -r 480`)
+    await servers[0].cli.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[2]} --generate-hls -r 480`)
 
     await waitJobs(servers)
 
     for (const server of servers) {
-      const videoDetails = await server.videosCommand.get({ id: videosUUID[2] })
+      const videoDetails = await server.videos.get({ id: videosUUID[2] })
 
       expect(videoDetails.files).to.have.lengthOf(1)
       expect(videoDetails.streamingPlaylists).to.have.lengthOf(1)
@@ -150,12 +150,12 @@ describe('Test create transcoding jobs', function () {
   it('Should not duplicate an HLS resolution', async function () {
     this.timeout(120000)
 
-    await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[2]} --generate-hls -r 480`)
+    await servers[0].cli.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[2]} --generate-hls -r 480`)
 
     await waitJobs(servers)
 
     for (const server of servers) {
-      const videoDetails = await server.videosCommand.get({ id: videosUUID[2] })
+      const videoDetails = await server.videos.get({ id: videosUUID[2] })
 
       const files = videoDetails.streamingPlaylists[0].files
       expect(files).to.have.lengthOf(1)
@@ -166,12 +166,12 @@ describe('Test create transcoding jobs', function () {
   it('Should generate all HLS resolutions', async function () {
     this.timeout(120000)
 
-    await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[3]} --generate-hls`)
+    await servers[0].cli.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[3]} --generate-hls`)
 
     await waitJobs(servers)
 
     for (const server of servers) {
-      const videoDetails = await server.videosCommand.get({ id: videosUUID[3] })
+      const videoDetails = await server.videos.get({ id: videosUUID[3] })
 
       expect(videoDetails.files).to.have.lengthOf(1)
       expect(videoDetails.streamingPlaylists).to.have.lengthOf(1)
@@ -185,14 +185,14 @@ describe('Test create transcoding jobs', function () {
     this.timeout(120000)
 
     config.transcoding.hls.enabled = true
-    await servers[0].configCommand.updateCustomSubConfig({ newConfig: config })
+    await servers[0].config.updateCustomSubConfig({ newConfig: config })
 
-    await servers[0].cliCommand.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[4]}`)
+    await servers[0].cli.execWithEnv(`npm run create-transcoding-job -- -v ${videosUUID[4]}`)
 
     await waitJobs(servers)
 
     for (const server of servers) {
-      const videoDetails = await server.videosCommand.get({ id: videosUUID[4] })
+      const videoDetails = await server.videos.get({ id: videosUUID[4] })
 
       expect(videoDetails.files).to.have.lengthOf(4)
       expect(videoDetails.streamingPlaylists).to.have.lengthOf(1)