diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-03 09:06:51 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-03 09:06:51 +0200 |
commit | 63da15eb18065ef6c419f073c95fec6ef5541652 (patch) | |
tree | a95855514d4d7ed8dd1bba0934d8640902ff330e /server/tests/external-plugins/auto-block-videos.ts | |
parent | 38c5c166f4204292d58f61658a063408a9e7b78c (diff) | |
download | PeerTube-63da15eb18065ef6c419f073c95fec6ef5541652.tar.gz PeerTube-63da15eb18065ef6c419f073c95fec6ef5541652.tar.zst PeerTube-63da15eb18065ef6c419f073c95fec6ef5541652.zip |
Use random port for mock servers in tests
Diffstat (limited to 'server/tests/external-plugins/auto-block-videos.ts')
-rw-r--r-- | server/tests/external-plugins/auto-block-videos.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/tests/external-plugins/auto-block-videos.ts b/server/tests/external-plugins/auto-block-videos.ts index 1b91d141e..18ea17d78 100644 --- a/server/tests/external-plugins/auto-block-videos.ts +++ b/server/tests/external-plugins/auto-block-videos.ts | |||
@@ -40,6 +40,7 @@ describe('Official plugin auto-block videos', function () { | |||
40 | let blocklistServer: MockBlocklist | 40 | let blocklistServer: MockBlocklist |
41 | let server1Videos: Video[] = [] | 41 | let server1Videos: Video[] = [] |
42 | let server2Videos: Video[] = [] | 42 | let server2Videos: Video[] = [] |
43 | let port: number | ||
43 | 44 | ||
44 | before(async function () { | 45 | before(async function () { |
45 | this.timeout(60000) | 46 | this.timeout(60000) |
@@ -56,7 +57,7 @@ describe('Official plugin auto-block videos', function () { | |||
56 | } | 57 | } |
57 | 58 | ||
58 | blocklistServer = new MockBlocklist() | 59 | blocklistServer = new MockBlocklist() |
59 | await blocklistServer.initialize() | 60 | port = await blocklistServer.initialize() |
60 | 61 | ||
61 | await uploadVideoAndGetId({ server: servers[0], videoName: 'video server 1' }) | 62 | await uploadVideoAndGetId({ server: servers[0], videoName: 'video server 1' }) |
62 | await uploadVideoAndGetId({ server: servers[1], videoName: 'video server 2' }) | 63 | await uploadVideoAndGetId({ server: servers[1], videoName: 'video server 2' }) |
@@ -82,7 +83,7 @@ describe('Official plugin auto-block videos', function () { | |||
82 | accessToken: servers[0].accessToken, | 83 | accessToken: servers[0].accessToken, |
83 | npmName: 'peertube-plugin-auto-block-videos', | 84 | npmName: 'peertube-plugin-auto-block-videos', |
84 | settings: { | 85 | settings: { |
85 | 'blocklist-urls': 'http://localhost:42100/blocklist', | 86 | 'blocklist-urls': `http://localhost:${port}/blocklist`, |
86 | 'check-seconds-interval': 1 | 87 | 'check-seconds-interval': 1 |
87 | } | 88 | } |
88 | }) | 89 | }) |