diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-24 10:53:40 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-24 16:26:23 +0200 |
commit | 210feb6cc484a6c5c63c98f770de34e223f944cb (patch) | |
tree | d1d841892a7ac87ac0d434194597606a375aaed1 /server/tests/api/users | |
parent | 9cc8d43e37a61709e7275c2a799bdf976dd940ca (diff) | |
download | PeerTube-210feb6cc484a6c5c63c98f770de34e223f944cb.tar.gz PeerTube-210feb6cc484a6c5c63c98f770de34e223f944cb.tar.zst PeerTube-210feb6cc484a6c5c63c98f770de34e223f944cb.zip |
Cleanup tests
Diffstat (limited to 'server/tests/api/users')
-rw-r--r-- | server/tests/api/users/blocklist.ts | 9 | ||||
-rw-r--r-- | server/tests/api/users/user-subscriptions.ts | 2 | ||||
-rw-r--r-- | server/tests/api/users/users-multiple-servers.ts | 2 | ||||
-rw-r--r-- | server/tests/api/users/users-verification.ts | 13 | ||||
-rw-r--r-- | server/tests/api/users/users.ts | 13 |
5 files changed, 9 insertions, 30 deletions
diff --git a/server/tests/api/users/blocklist.ts b/server/tests/api/users/blocklist.ts index cd96ffe2a..34eabf2e6 100644 --- a/server/tests/api/users/blocklist.ts +++ b/server/tests/api/users/blocklist.ts | |||
@@ -79,8 +79,6 @@ describe('Test blocklist', function () { | |||
79 | before(async function () { | 79 | before(async function () { |
80 | this.timeout(60000) | 80 | this.timeout(60000) |
81 | 81 | ||
82 | await flushTests() | ||
83 | |||
84 | servers = await flushAndRunMultipleServers(2) | 82 | servers = await flushAndRunMultipleServers(2) |
85 | await setAccessTokensToServers(servers) | 83 | await setAccessTokensToServers(servers) |
86 | 84 | ||
@@ -500,12 +498,7 @@ describe('Test blocklist', function () { | |||
500 | }) | 498 | }) |
501 | }) | 499 | }) |
502 | 500 | ||
503 | after(async function () { | 501 | after(function () { |
504 | killallServers(servers) | 502 | killallServers(servers) |
505 | |||
506 | // Keep the logs if the test failed | ||
507 | if (this[ 'ok' ]) { | ||
508 | await flushTests() | ||
509 | } | ||
510 | }) | 503 | }) |
511 | }) | 504 | }) |
diff --git a/server/tests/api/users/user-subscriptions.ts b/server/tests/api/users/user-subscriptions.ts index 5be185678..ee5abd6b7 100644 --- a/server/tests/api/users/user-subscriptions.ts +++ b/server/tests/api/users/user-subscriptions.ts | |||
@@ -368,7 +368,7 @@ describe('Test users subscriptions', function () { | |||
368 | } | 368 | } |
369 | }) | 369 | }) |
370 | 370 | ||
371 | after(async function () { | 371 | after(function () { |
372 | killallServers(servers) | 372 | killallServers(servers) |
373 | }) | 373 | }) |
374 | }) | 374 | }) |
diff --git a/server/tests/api/users/users-multiple-servers.ts b/server/tests/api/users/users-multiple-servers.ts index 9b8db0072..7097d90d1 100644 --- a/server/tests/api/users/users-multiple-servers.ts +++ b/server/tests/api/users/users-multiple-servers.ts | |||
@@ -235,7 +235,7 @@ describe('Test users with multiple servers', function () { | |||
235 | } | 235 | } |
236 | }) | 236 | }) |
237 | 237 | ||
238 | after(async function () { | 238 | after(function () { |
239 | killallServers(servers) | 239 | killallServers(servers) |
240 | }) | 240 | }) |
241 | }) | 241 | }) |
diff --git a/server/tests/api/users/users-verification.ts b/server/tests/api/users/users-verification.ts index 7fcd3e50b..295caae97 100644 --- a/server/tests/api/users/users-verification.ts +++ b/server/tests/api/users/users-verification.ts | |||
@@ -4,7 +4,7 @@ import * as chai from 'chai' | |||
4 | import 'mocha' | 4 | import 'mocha' |
5 | import { | 5 | import { |
6 | registerUser, flushTests, getUserInformation, getMyUserInformation, killallServers, | 6 | registerUser, flushTests, getUserInformation, getMyUserInformation, killallServers, |
7 | userLogin, login, runServer, ServerInfo, verifyEmail, updateCustomSubConfig, wait | 7 | userLogin, login, flushAndRunServer, ServerInfo, verifyEmail, updateCustomSubConfig, wait |
8 | } from '../../../../shared/extra-utils' | 8 | } from '../../../../shared/extra-utils' |
9 | import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login' | 9 | import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login' |
10 | import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' | 10 | import { MockSmtpServer } from '../../../../shared/extra-utils/miscs/email' |
@@ -32,14 +32,12 @@ describe('Test users account verification', function () { | |||
32 | 32 | ||
33 | await MockSmtpServer.Instance.collectEmails(emails) | 33 | await MockSmtpServer.Instance.collectEmails(emails) |
34 | 34 | ||
35 | await flushTests() | ||
36 | |||
37 | const overrideConfig = { | 35 | const overrideConfig = { |
38 | smtp: { | 36 | smtp: { |
39 | hostname: 'localhost' | 37 | hostname: 'localhost' |
40 | } | 38 | } |
41 | } | 39 | } |
42 | server = await runServer(1, overrideConfig) | 40 | server = await flushAndRunServer(1, overrideConfig) |
43 | 41 | ||
44 | await setAccessTokensToServers([ server ]) | 42 | await setAccessTokensToServers([ server ]) |
45 | }) | 43 | }) |
@@ -122,13 +120,8 @@ describe('Test users account verification', function () { | |||
122 | await userLogin(server, user2) | 120 | await userLogin(server, user2) |
123 | }) | 121 | }) |
124 | 122 | ||
125 | after(async function () { | 123 | after(function () { |
126 | MockSmtpServer.Instance.kill() | 124 | MockSmtpServer.Instance.kill() |
127 | killallServers([ server ]) | 125 | killallServers([ server ]) |
128 | |||
129 | // Keep the logs if the test failed | ||
130 | if (this[ 'ok' ]) { | ||
131 | await flushTests() | ||
132 | } | ||
133 | }) | 126 | }) |
134 | }) | 127 | }) |
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index 472ff511c..8efff12ad 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts | |||
@@ -24,7 +24,7 @@ import { | |||
24 | registerUser, | 24 | registerUser, |
25 | removeUser, | 25 | removeUser, |
26 | removeVideo, | 26 | removeVideo, |
27 | runServer, | 27 | flushAndRunServer, |
28 | ServerInfo, | 28 | ServerInfo, |
29 | testImage, | 29 | testImage, |
30 | unblockUser, | 30 | unblockUser, |
@@ -54,9 +54,7 @@ describe('Test users', function () { | |||
54 | 54 | ||
55 | before(async function () { | 55 | before(async function () { |
56 | this.timeout(30000) | 56 | this.timeout(30000) |
57 | 57 | server = await flushAndRunServer(1) | |
58 | await flushTests() | ||
59 | server = await runServer(1) | ||
60 | 58 | ||
61 | await setAccessTokensToServers([ server ]) | 59 | await setAccessTokensToServers([ server ]) |
62 | }) | 60 | }) |
@@ -679,12 +677,7 @@ describe('Test users', function () { | |||
679 | }) | 677 | }) |
680 | }) | 678 | }) |
681 | 679 | ||
682 | after(async function () { | 680 | after(function () { |
683 | killallServers([ server ]) | 681 | killallServers([ server ]) |
684 | |||
685 | // Keep the logs if the test failed | ||
686 | if (this[ 'ok' ]) { | ||
687 | await flushTests() | ||
688 | } | ||
689 | }) | 682 | }) |
690 | }) | 683 | }) |