aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/runners
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-07-27 11:44:31 +0200
committerChocobozzz <me@florianbigard.com>2023-07-27 14:17:12 +0200
commitf18003d0ac5c3fc6ec8de2a89102d1e1e89182df (patch)
tree0b3baa5658478607f3417fe7c747cc3a782f15b3 /server/tests/api/runners
parentf5af5feb5a41eb6e2796e480402106b55bd10f04 (diff)
downloadPeerTube-f18003d0ac5c3fc6ec8de2a89102d1e1e89182df.tar.gz
PeerTube-f18003d0ac5c3fc6ec8de2a89102d1e1e89182df.tar.zst
PeerTube-f18003d0ac5c3fc6ec8de2a89102d1e1e89182df.zip
Improve runner management
* Add ability to remove runner jobs * Add runner job state quick filter * Merge registration tokens and runners tables in the same page * Add copy button to copy registration token
Diffstat (limited to 'server/tests/api/runners')
-rw-r--r--server/tests/api/runners/runner-common.ts51
1 files changed, 51 insertions, 0 deletions
diff --git a/server/tests/api/runners/runner-common.ts b/server/tests/api/runners/runner-common.ts
index 34a51abe7..7fed75f40 100644
--- a/server/tests/api/runners/runner-common.ts
+++ b/server/tests/api/runners/runner-common.ts
@@ -339,6 +339,30 @@ describe('Test runner common actions', function () {
339 339
340 expect(data).to.not.have.lengthOf(0) 340 expect(data).to.not.have.lengthOf(0)
341 expect(total).to.not.equal(0) 341 expect(total).to.not.equal(0)
342
343 for (const job of data) {
344 expect(job.type).to.include('hls')
345 }
346 }
347 })
348
349 it('Should filter jobs', async function () {
350 {
351 const { total, data } = await server.runnerJobs.list({ stateOneOf: [ RunnerJobState.WAITING_FOR_PARENT_JOB ] })
352
353 expect(data).to.not.have.lengthOf(0)
354 expect(total).to.not.equal(0)
355
356 for (const job of data) {
357 expect(job.state.label).to.equal('Waiting for parent job to finish')
358 }
359 }
360
361 {
362 const { total, data } = await server.runnerJobs.list({ stateOneOf: [ RunnerJobState.COMPLETED ] })
363
364 expect(data).to.have.lengthOf(0)
365 expect(total).to.equal(0)
342 } 366 }
343 }) 367 })
344 }) 368 })
@@ -598,6 +622,33 @@ describe('Test runner common actions', function () {
598 }) 622 })
599 }) 623 })
600 624
625 describe('Remove', function () {
626
627 it('Should remove a pending job', async function () {
628 await server.videos.quickUpload({ name: 'video' })
629 await waitJobs([ server ])
630
631 {
632 const { data } = await server.runnerJobs.list({ count: 10, sort: '-updatedAt' })
633
634 const pendingJob = data.find(j => j.state.id === RunnerJobState.PENDING)
635 jobUUID = pendingJob.uuid
636
637 await server.runnerJobs.deleteByAdmin({ jobUUID })
638 }
639
640 {
641 const { data } = await server.runnerJobs.list({ count: 10, sort: '-updatedAt' })
642
643 const parent = data.find(j => j.uuid === jobUUID)
644 expect(parent).to.not.exist
645
646 const children = data.filter(j => j.parent?.uuid === jobUUID)
647 expect(children).to.have.lengthOf(0)
648 }
649 })
650 })
651
601 describe('Stalled jobs', function () { 652 describe('Stalled jobs', function () {
602 653
603 it('Should abort stalled jobs', async function () { 654 it('Should abort stalled jobs', async function () {