diff options
author | Chocobozzz <me@florianbigard.com> | 2023-04-21 15:00:01 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2023-05-09 08:57:34 +0200 |
commit | d102de1b38f2877463529c3b27bd35ffef4fd8bf (patch) | |
tree | 31fa0bdf26ad7a2ee46d600d804a6f03260266c8 /server/tests/api/live/live.ts | |
parent | 2fe978744e5b74eb824e4d79c1bb9b840169f125 (diff) | |
download | PeerTube-d102de1b38f2877463529c3b27bd35ffef4fd8bf.tar.gz PeerTube-d102de1b38f2877463529c3b27bd35ffef4fd8bf.tar.zst PeerTube-d102de1b38f2877463529c3b27bd35ffef4fd8bf.zip |
Add runner server tests
Diffstat (limited to 'server/tests/api/live/live.ts')
-rw-r--r-- | server/tests/api/live/live.ts | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/server/tests/api/live/live.ts b/server/tests/api/live/live.ts index ceb606af1..f9b0d257b 100644 --- a/server/tests/api/live/live.ts +++ b/server/tests/api/live/live.ts | |||
@@ -2,9 +2,9 @@ | |||
2 | 2 | ||
3 | import { expect } from 'chai' | 3 | import { expect } from 'chai' |
4 | import { basename, join } from 'path' | 4 | import { basename, join } from 'path' |
5 | import { ffprobePromise, getVideoStream } from '@server/helpers/ffmpeg' | 5 | import { SQLCommand, testImage, testLiveVideoResolutions } from '@server/tests/shared' |
6 | import { testImage, testVideoResolutions } from '@server/tests/shared' | ||
7 | import { getAllFiles, wait } from '@shared/core-utils' | 6 | import { getAllFiles, wait } from '@shared/core-utils' |
7 | import { ffprobePromise, getVideoStream } from '@shared/ffmpeg' | ||
8 | import { | 8 | import { |
9 | HttpStatusCode, | 9 | HttpStatusCode, |
10 | LiveVideo, | 10 | LiveVideo, |
@@ -365,6 +365,7 @@ describe('Test live', function () { | |||
365 | 365 | ||
366 | describe('Live transcoding', function () { | 366 | describe('Live transcoding', function () { |
367 | let liveVideoId: string | 367 | let liveVideoId: string |
368 | let sqlCommandServer1: SQLCommand | ||
368 | 369 | ||
369 | async function createLiveWrapper (saveReplay: boolean) { | 370 | async function createLiveWrapper (saveReplay: boolean) { |
370 | const liveAttributes = { | 371 | const liveAttributes = { |
@@ -407,6 +408,8 @@ describe('Test live', function () { | |||
407 | 408 | ||
408 | before(async function () { | 409 | before(async function () { |
409 | await updateConf([]) | 410 | await updateConf([]) |
411 | |||
412 | sqlCommandServer1 = new SQLCommand(servers[0]) | ||
410 | }) | 413 | }) |
411 | 414 | ||
412 | it('Should enable transcoding without additional resolutions', async function () { | 415 | it('Should enable transcoding without additional resolutions', async function () { |
@@ -418,8 +421,9 @@ describe('Test live', function () { | |||
418 | await waitUntilLivePublishedOnAllServers(servers, liveVideoId) | 421 | await waitUntilLivePublishedOnAllServers(servers, liveVideoId) |
419 | await waitJobs(servers) | 422 | await waitJobs(servers) |
420 | 423 | ||
421 | await testVideoResolutions({ | 424 | await testLiveVideoResolutions({ |
422 | originServer: servers[0], | 425 | originServer: servers[0], |
426 | sqlCommand: sqlCommandServer1, | ||
423 | servers, | 427 | servers, |
424 | liveVideoId, | 428 | liveVideoId, |
425 | resolutions: [ 720 ], | 429 | resolutions: [ 720 ], |
@@ -453,8 +457,9 @@ describe('Test live', function () { | |||
453 | await waitUntilLivePublishedOnAllServers(servers, liveVideoId) | 457 | await waitUntilLivePublishedOnAllServers(servers, liveVideoId) |
454 | await waitJobs(servers) | 458 | await waitJobs(servers) |
455 | 459 | ||
456 | await testVideoResolutions({ | 460 | await testLiveVideoResolutions({ |
457 | originServer: servers[0], | 461 | originServer: servers[0], |
462 | sqlCommand: sqlCommandServer1, | ||
458 | servers, | 463 | servers, |
459 | liveVideoId, | 464 | liveVideoId, |
460 | resolutions: resolutions.concat([ 720 ]), | 465 | resolutions: resolutions.concat([ 720 ]), |
@@ -505,8 +510,9 @@ describe('Test live', function () { | |||
505 | await waitUntilLivePublishedOnAllServers(servers, liveVideoId) | 510 | await waitUntilLivePublishedOnAllServers(servers, liveVideoId) |
506 | await waitJobs(servers) | 511 | await waitJobs(servers) |
507 | 512 | ||
508 | await testVideoResolutions({ | 513 | await testLiveVideoResolutions({ |
509 | originServer: servers[0], | 514 | originServer: servers[0], |
515 | sqlCommand: sqlCommandServer1, | ||
510 | servers, | 516 | servers, |
511 | liveVideoId, | 517 | liveVideoId, |
512 | resolutions, | 518 | resolutions, |
@@ -601,8 +607,9 @@ describe('Test live', function () { | |||
601 | await waitUntilLivePublishedOnAllServers(servers, liveVideoId) | 607 | await waitUntilLivePublishedOnAllServers(servers, liveVideoId) |
602 | await waitJobs(servers) | 608 | await waitJobs(servers) |
603 | 609 | ||
604 | await testVideoResolutions({ | 610 | await testLiveVideoResolutions({ |
605 | originServer: servers[0], | 611 | originServer: servers[0], |
612 | sqlCommand: sqlCommandServer1, | ||
606 | servers, | 613 | servers, |
607 | liveVideoId, | 614 | liveVideoId, |
608 | resolutions, | 615 | resolutions, |
@@ -637,8 +644,9 @@ describe('Test live', function () { | |||
637 | await waitUntilLivePublishedOnAllServers(servers, liveVideoId) | 644 | await waitUntilLivePublishedOnAllServers(servers, liveVideoId) |
638 | await waitJobs(servers) | 645 | await waitJobs(servers) |
639 | 646 | ||
640 | await testVideoResolutions({ | 647 | await testLiveVideoResolutions({ |
641 | originServer: servers[0], | 648 | originServer: servers[0], |
649 | sqlCommand: sqlCommandServer1, | ||
642 | servers, | 650 | servers, |
643 | liveVideoId, | 651 | liveVideoId, |
644 | resolutions: [ 720 ], | 652 | resolutions: [ 720 ], |
@@ -661,6 +669,10 @@ describe('Test live', function () { | |||
661 | 669 | ||
662 | expect(hlsFiles[0].resolution.id).to.equal(720) | 670 | expect(hlsFiles[0].resolution.id).to.equal(720) |
663 | }) | 671 | }) |
672 | |||
673 | after(async function () { | ||
674 | await sqlCommandServer1.cleanup() | ||
675 | }) | ||
664 | }) | 676 | }) |
665 | 677 | ||
666 | describe('After a server restart', function () { | 678 | describe('After a server restart', function () { |