diff options
Diffstat (limited to 'server/tests/api/redundancy')
-rw-r--r-- | server/tests/api/redundancy/manage-redundancy.ts | 2 | ||||
-rw-r--r-- | server/tests/api/redundancy/redundancy-constraints.ts | 9 | ||||
-rw-r--r-- | server/tests/api/redundancy/redundancy.ts | 41 |
3 files changed, 28 insertions, 24 deletions
diff --git a/server/tests/api/redundancy/manage-redundancy.ts b/server/tests/api/redundancy/manage-redundancy.ts index 5fd464ded..cbf3106bd 100644 --- a/server/tests/api/redundancy/manage-redundancy.ts +++ b/server/tests/api/redundancy/manage-redundancy.ts | |||
@@ -10,7 +10,7 @@ import { | |||
10 | RedundancyCommand, | 10 | RedundancyCommand, |
11 | setAccessTokensToServers, | 11 | setAccessTokensToServers, |
12 | waitJobs | 12 | waitJobs |
13 | } from '@shared/extra-utils' | 13 | } from '@shared/server-commands' |
14 | import { VideoPrivacy, VideoRedundanciesTarget } from '@shared/models' | 14 | import { VideoPrivacy, VideoRedundanciesTarget } from '@shared/models' |
15 | 15 | ||
16 | const expect = chai.expect | 16 | const expect = chai.expect |
diff --git a/server/tests/api/redundancy/redundancy-constraints.ts b/server/tests/api/redundancy/redundancy-constraints.ts index 933a2c776..17c6b25a5 100644 --- a/server/tests/api/redundancy/redundancy-constraints.ts +++ b/server/tests/api/redundancy/redundancy-constraints.ts | |||
@@ -2,8 +2,15 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { expect } from 'chai' | 4 | import { expect } from 'chai' |
5 | import { cleanupTests, createSingleServer, killallServers, PeerTubeServer, setAccessTokensToServers, waitJobs } from '@shared/extra-utils' | ||
6 | import { VideoPrivacy } from '@shared/models' | 5 | import { VideoPrivacy } from '@shared/models' |
6 | import { | ||
7 | cleanupTests, | ||
8 | createSingleServer, | ||
9 | killallServers, | ||
10 | PeerTubeServer, | ||
11 | setAccessTokensToServers, | ||
12 | waitJobs | ||
13 | } from '@shared/server-commands' | ||
7 | 14 | ||
8 | describe('Test redundancy constraints', function () { | 15 | describe('Test redundancy constraints', function () { |
9 | let remoteServer: PeerTubeServer | 16 | let remoteServer: PeerTubeServer |
diff --git a/server/tests/api/redundancy/redundancy.ts b/server/tests/api/redundancy/redundancy.ts index 86b40cfe6..3f2286278 100644 --- a/server/tests/api/redundancy/redundancy.ts +++ b/server/tests/api/redundancy/redundancy.ts | |||
@@ -5,29 +5,26 @@ import * as chai from 'chai' | |||
5 | import { readdir } from 'fs-extra' | 5 | import { readdir } from 'fs-extra' |
6 | import magnetUtil from 'magnet-uri' | 6 | import magnetUtil from 'magnet-uri' |
7 | import { basename, join } from 'path' | 7 | import { basename, join } from 'path' |
8 | import { checkSegmentHash, checkVideoFilesWereRemoved, saveVideoInServers } from '@server/tests/shared' | ||
9 | import { root, wait } from '@shared/core-utils' | ||
10 | import { | ||
11 | HttpStatusCode, | ||
12 | VideoDetails, | ||
13 | VideoFile, | ||
14 | VideoPrivacy, | ||
15 | VideoRedundancyStrategy, | ||
16 | VideoRedundancyStrategyWithManual | ||
17 | } from '@shared/models' | ||
8 | import { | 18 | import { |
9 | checkSegmentHash, | ||
10 | checkVideoFilesWereRemoved, | ||
11 | cleanupTests, | 19 | cleanupTests, |
12 | createMultipleServers, | 20 | createMultipleServers, |
13 | doubleFollow, | 21 | doubleFollow, |
14 | killallServers, | 22 | killallServers, |
15 | makeRawRequest, | 23 | makeRawRequest, |
16 | PeerTubeServer, | 24 | PeerTubeServer, |
17 | root, | ||
18 | saveVideoInServers, | ||
19 | setAccessTokensToServers, | 25 | setAccessTokensToServers, |
20 | wait, | ||
21 | waitJobs | 26 | waitJobs |
22 | } from '@shared/extra-utils' | 27 | } from '@shared/server-commands' |
23 | import { | ||
24 | HttpStatusCode, | ||
25 | VideoDetails, | ||
26 | VideoFile, | ||
27 | VideoPrivacy, | ||
28 | VideoRedundancyStrategy, | ||
29 | VideoRedundancyStrategyWithManual | ||
30 | } from '@shared/models' | ||
31 | 28 | ||
32 | const expect = chai.expect | 29 | const expect = chai.expect |
33 | 30 | ||
@@ -307,7 +304,7 @@ describe('Test videos redundancy', function () { | |||
307 | const strategy = 'most-views' | 304 | const strategy = 'most-views' |
308 | 305 | ||
309 | before(function () { | 306 | before(function () { |
310 | this.timeout(120000) | 307 | this.timeout(240000) |
311 | 308 | ||
312 | return createServers(strategy) | 309 | return createServers(strategy) |
313 | }) | 310 | }) |
@@ -357,7 +354,7 @@ describe('Test videos redundancy', function () { | |||
357 | const strategy = 'trending' | 354 | const strategy = 'trending' |
358 | 355 | ||
359 | before(function () { | 356 | before(function () { |
360 | this.timeout(120000) | 357 | this.timeout(240000) |
361 | 358 | ||
362 | return createServers(strategy) | 359 | return createServers(strategy) |
363 | }) | 360 | }) |
@@ -420,7 +417,7 @@ describe('Test videos redundancy', function () { | |||
420 | const strategy = 'recently-added' | 417 | const strategy = 'recently-added' |
421 | 418 | ||
422 | before(function () { | 419 | before(function () { |
423 | this.timeout(120000) | 420 | this.timeout(240000) |
424 | 421 | ||
425 | return createServers(strategy, { min_views: 3 }) | 422 | return createServers(strategy, { min_views: 3 }) |
426 | }) | 423 | }) |
@@ -491,7 +488,7 @@ describe('Test videos redundancy', function () { | |||
491 | const strategy = 'recently-added' | 488 | const strategy = 'recently-added' |
492 | 489 | ||
493 | before(async function () { | 490 | before(async function () { |
494 | this.timeout(120000) | 491 | this.timeout(240000) |
495 | 492 | ||
496 | await createServers(strategy, { min_views: 3 }, false) | 493 | await createServers(strategy, { min_views: 3 }, false) |
497 | }) | 494 | }) |
@@ -553,7 +550,7 @@ describe('Test videos redundancy', function () { | |||
553 | 550 | ||
554 | describe('With manual strategy', function () { | 551 | describe('With manual strategy', function () { |
555 | before(function () { | 552 | before(function () { |
556 | this.timeout(120000) | 553 | this.timeout(240000) |
557 | 554 | ||
558 | return createServers(null) | 555 | return createServers(null) |
559 | }) | 556 | }) |
@@ -632,7 +629,7 @@ describe('Test videos redundancy', function () { | |||
632 | } | 629 | } |
633 | 630 | ||
634 | before(async function () { | 631 | before(async function () { |
635 | this.timeout(120000) | 632 | this.timeout(240000) |
636 | 633 | ||
637 | await createServers(strategy, { min_lifetime: '7 seconds', min_views: 0 }) | 634 | await createServers(strategy, { min_lifetime: '7 seconds', min_views: 0 }) |
638 | 635 | ||
@@ -674,7 +671,7 @@ describe('Test videos redundancy', function () { | |||
674 | const strategy = 'recently-added' | 671 | const strategy = 'recently-added' |
675 | 672 | ||
676 | before(async function () { | 673 | before(async function () { |
677 | this.timeout(120000) | 674 | this.timeout(240000) |
678 | 675 | ||
679 | await createServers(strategy, { min_lifetime: '7 seconds', min_views: 0 }) | 676 | await createServers(strategy, { min_lifetime: '7 seconds', min_views: 0 }) |
680 | 677 | ||
@@ -698,7 +695,7 @@ describe('Test videos redundancy', function () { | |||
698 | }) | 695 | }) |
699 | 696 | ||
700 | it('Should cache video 2 webseeds on the first video', async function () { | 697 | it('Should cache video 2 webseeds on the first video', async function () { |
701 | this.timeout(120000) | 698 | this.timeout(240000) |
702 | 699 | ||
703 | await waitJobs(servers) | 700 | await waitJobs(servers) |
704 | 701 | ||