diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-25 17:14:49 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-05-14 15:37:43 +0200 |
commit | 7243f84db0f34c6d5610a54603b0cce7c284a7b3 (patch) | |
tree | c913e9342ec83098bf30c1debd609a15318bc0fb /server/tests/api/users | |
parent | da3a3ab6829107b3ed7f18dda42648dfde41871d (diff) | |
download | PeerTube-7243f84db0f34c6d5610a54603b0cce7c284a7b3.tar.gz PeerTube-7243f84db0f34c6d5610a54603b0cce7c284a7b3.tar.zst PeerTube-7243f84db0f34c6d5610a54603b0cce7c284a7b3.zip |
Redundancy and search tests in parallel too
Diffstat (limited to 'server/tests/api/users')
-rw-r--r-- | server/tests/api/users/blocklist.ts | 28 | ||||
-rw-r--r-- | server/tests/api/users/users-verification.ts | 5 |
2 files changed, 17 insertions, 16 deletions
diff --git a/server/tests/api/users/blocklist.ts b/server/tests/api/users/blocklist.ts index fbc57e0ef..c25e85ada 100644 --- a/server/tests/api/users/blocklist.ts +++ b/server/tests/api/users/blocklist.ts | |||
@@ -144,7 +144,7 @@ describe('Test blocklist', function () { | |||
144 | }) | 144 | }) |
145 | 145 | ||
146 | it('Should block a remote account', async function () { | 146 | it('Should block a remote account', async function () { |
147 | await addAccountToAccountBlocklist(servers[ 0 ].url, servers[ 0 ].accessToken, 'user2@localhost:9002') | 147 | await addAccountToAccountBlocklist(servers[ 0 ].url, servers[ 0 ].accessToken, 'user2@localhost:' + servers[1].port) |
148 | }) | 148 | }) |
149 | 149 | ||
150 | it('Should hide its videos', async function () { | 150 | it('Should hide its videos', async function () { |
@@ -209,7 +209,7 @@ describe('Test blocklist', function () { | |||
209 | expect(block.byAccount.name).to.equal('root') | 209 | expect(block.byAccount.name).to.equal('root') |
210 | expect(block.blockedAccount.displayName).to.equal('user2') | 210 | expect(block.blockedAccount.displayName).to.equal('user2') |
211 | expect(block.blockedAccount.name).to.equal('user2') | 211 | expect(block.blockedAccount.name).to.equal('user2') |
212 | expect(block.blockedAccount.host).to.equal('localhost:9002') | 212 | expect(block.blockedAccount.host).to.equal('localhost:' + servers[1].port) |
213 | } | 213 | } |
214 | 214 | ||
215 | { | 215 | { |
@@ -223,12 +223,12 @@ describe('Test blocklist', function () { | |||
223 | expect(block.byAccount.name).to.equal('root') | 223 | expect(block.byAccount.name).to.equal('root') |
224 | expect(block.blockedAccount.displayName).to.equal('user1') | 224 | expect(block.blockedAccount.displayName).to.equal('user1') |
225 | expect(block.blockedAccount.name).to.equal('user1') | 225 | expect(block.blockedAccount.name).to.equal('user1') |
226 | expect(block.blockedAccount.host).to.equal('localhost:9001') | 226 | expect(block.blockedAccount.host).to.equal('localhost:' + servers[0].port) |
227 | } | 227 | } |
228 | }) | 228 | }) |
229 | 229 | ||
230 | it('Should unblock the remote account', async function () { | 230 | it('Should unblock the remote account', async function () { |
231 | await removeAccountFromAccountBlocklist(servers[ 0 ].url, servers[ 0 ].accessToken, 'user2@localhost:9002') | 231 | await removeAccountFromAccountBlocklist(servers[ 0 ].url, servers[ 0 ].accessToken, 'user2@localhost:' + servers[1].port) |
232 | }) | 232 | }) |
233 | 233 | ||
234 | it('Should display its videos', async function () { | 234 | it('Should display its videos', async function () { |
@@ -260,7 +260,7 @@ describe('Test blocklist', function () { | |||
260 | }) | 260 | }) |
261 | 261 | ||
262 | it('Should block a remote server', async function () { | 262 | it('Should block a remote server', async function () { |
263 | await addServerToAccountBlocklist(servers[ 0 ].url, servers[ 0 ].accessToken, 'localhost:9002') | 263 | await addServerToAccountBlocklist(servers[ 0 ].url, servers[ 0 ].accessToken, 'localhost:' + servers[1].port) |
264 | }) | 264 | }) |
265 | 265 | ||
266 | it('Should hide its videos', async function () { | 266 | it('Should hide its videos', async function () { |
@@ -291,11 +291,11 @@ describe('Test blocklist', function () { | |||
291 | const block = blocks[ 0 ] | 291 | const block = blocks[ 0 ] |
292 | expect(block.byAccount.displayName).to.equal('root') | 292 | expect(block.byAccount.displayName).to.equal('root') |
293 | expect(block.byAccount.name).to.equal('root') | 293 | expect(block.byAccount.name).to.equal('root') |
294 | expect(block.blockedServer.host).to.equal('localhost:9002') | 294 | expect(block.blockedServer.host).to.equal('localhost:' + servers[1].port) |
295 | }) | 295 | }) |
296 | 296 | ||
297 | it('Should unblock the remote server', async function () { | 297 | it('Should unblock the remote server', async function () { |
298 | await removeServerFromAccountBlocklist(servers[ 0 ].url, servers[ 0 ].accessToken, 'localhost:9002') | 298 | await removeServerFromAccountBlocklist(servers[ 0 ].url, servers[ 0 ].accessToken, 'localhost:' + servers[1].port) |
299 | }) | 299 | }) |
300 | 300 | ||
301 | it('Should display its videos', function () { | 301 | it('Should display its videos', function () { |
@@ -324,7 +324,7 @@ describe('Test blocklist', function () { | |||
324 | }) | 324 | }) |
325 | 325 | ||
326 | it('Should block a remote account', async function () { | 326 | it('Should block a remote account', async function () { |
327 | await addAccountToServerBlocklist(servers[ 0 ].url, servers[ 0 ].accessToken, 'user2@localhost:9002') | 327 | await addAccountToServerBlocklist(servers[ 0 ].url, servers[ 0 ].accessToken, 'user2@localhost:' + servers[1].port) |
328 | }) | 328 | }) |
329 | 329 | ||
330 | it('Should hide its videos', async function () { | 330 | it('Should hide its videos', async function () { |
@@ -387,7 +387,7 @@ describe('Test blocklist', function () { | |||
387 | expect(block.byAccount.name).to.equal('peertube') | 387 | expect(block.byAccount.name).to.equal('peertube') |
388 | expect(block.blockedAccount.displayName).to.equal('user2') | 388 | expect(block.blockedAccount.displayName).to.equal('user2') |
389 | expect(block.blockedAccount.name).to.equal('user2') | 389 | expect(block.blockedAccount.name).to.equal('user2') |
390 | expect(block.blockedAccount.host).to.equal('localhost:9002') | 390 | expect(block.blockedAccount.host).to.equal('localhost:' + servers[1].port) |
391 | } | 391 | } |
392 | 392 | ||
393 | { | 393 | { |
@@ -401,12 +401,12 @@ describe('Test blocklist', function () { | |||
401 | expect(block.byAccount.name).to.equal('peertube') | 401 | expect(block.byAccount.name).to.equal('peertube') |
402 | expect(block.blockedAccount.displayName).to.equal('user1') | 402 | expect(block.blockedAccount.displayName).to.equal('user1') |
403 | expect(block.blockedAccount.name).to.equal('user1') | 403 | expect(block.blockedAccount.name).to.equal('user1') |
404 | expect(block.blockedAccount.host).to.equal('localhost:9001') | 404 | expect(block.blockedAccount.host).to.equal('localhost:' + servers[0].port) |
405 | } | 405 | } |
406 | }) | 406 | }) |
407 | 407 | ||
408 | it('Should unblock the remote account', async function () { | 408 | it('Should unblock the remote account', async function () { |
409 | await removeAccountFromServerBlocklist(servers[ 0 ].url, servers[ 0 ].accessToken, 'user2@localhost:9002') | 409 | await removeAccountFromServerBlocklist(servers[ 0 ].url, servers[ 0 ].accessToken, 'user2@localhost:' + servers[1].port) |
410 | }) | 410 | }) |
411 | 411 | ||
412 | it('Should display its videos', async function () { | 412 | it('Should display its videos', async function () { |
@@ -446,7 +446,7 @@ describe('Test blocklist', function () { | |||
446 | }) | 446 | }) |
447 | 447 | ||
448 | it('Should block a remote server', async function () { | 448 | it('Should block a remote server', async function () { |
449 | await addServerToServerBlocklist(servers[ 0 ].url, servers[ 0 ].accessToken, 'localhost:9002') | 449 | await addServerToServerBlocklist(servers[ 0 ].url, servers[ 0 ].accessToken, 'localhost:' + servers[1].port) |
450 | }) | 450 | }) |
451 | 451 | ||
452 | it('Should hide its videos', async function () { | 452 | it('Should hide its videos', async function () { |
@@ -478,11 +478,11 @@ describe('Test blocklist', function () { | |||
478 | const block = blocks[ 0 ] | 478 | const block = blocks[ 0 ] |
479 | expect(block.byAccount.displayName).to.equal('peertube') | 479 | expect(block.byAccount.displayName).to.equal('peertube') |
480 | expect(block.byAccount.name).to.equal('peertube') | 480 | expect(block.byAccount.name).to.equal('peertube') |
481 | expect(block.blockedServer.host).to.equal('localhost:9002') | 481 | expect(block.blockedServer.host).to.equal('localhost:' + servers[1].port) |
482 | }) | 482 | }) |
483 | 483 | ||
484 | it('Should unblock the remote server', async function () { | 484 | it('Should unblock the remote server', async function () { |
485 | await removeServerFromServerBlocklist(servers[ 0 ].url, servers[ 0 ].accessToken, 'localhost:9002') | 485 | await removeServerFromServerBlocklist(servers[ 0 ].url, servers[ 0 ].accessToken, 'localhost:' + servers[1].port) |
486 | }) | 486 | }) |
487 | 487 | ||
488 | it('Should list all videos', async function () { | 488 | it('Should list all videos', async function () { |
diff --git a/server/tests/api/users/users-verification.ts b/server/tests/api/users/users-verification.ts index 514acf2e7..3b37a26cf 100644 --- a/server/tests/api/users/users-verification.ts +++ b/server/tests/api/users/users-verification.ts | |||
@@ -30,11 +30,12 @@ describe('Test users account verification', function () { | |||
30 | before(async function () { | 30 | before(async function () { |
31 | this.timeout(30000) | 31 | this.timeout(30000) |
32 | 32 | ||
33 | await MockSmtpServer.Instance.collectEmails(emails) | 33 | const port = await MockSmtpServer.Instance.collectEmails(emails) |
34 | 34 | ||
35 | const overrideConfig = { | 35 | const overrideConfig = { |
36 | smtp: { | 36 | smtp: { |
37 | hostname: 'localhost' | 37 | hostname: 'localhost', |
38 | port | ||
38 | } | 39 | } |
39 | } | 40 | } |
40 | server = await flushAndRunServer(1, overrideConfig) | 41 | server = await flushAndRunServer(1, overrideConfig) |