diff options
author | Chocobozzz <me@florianbigard.com> | 2022-02-28 15:51:41 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-02-28 15:51:41 +0100 |
commit | cba7977552e909ea0ea4dc526788a9166ad5f535 (patch) | |
tree | d8b327a9a20652b128139011cf42b389808df932 /shared/server-commands/server/servers-command.ts | |
parent | 5273f40afc08385f1ea00b6e40bd65532e272401 (diff) | |
download | PeerTube-cba7977552e909ea0ea4dc526788a9166ad5f535.tar.gz PeerTube-cba7977552e909ea0ea4dc526788a9166ad5f535.tar.zst PeerTube-cba7977552e909ea0ea4dc526788a9166ad5f535.zip |
Correctly cleanup server tests
Diffstat (limited to 'shared/server-commands/server/servers-command.ts')
-rw-r--r-- | shared/server-commands/server/servers-command.ts | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/shared/server-commands/server/servers-command.ts b/shared/server-commands/server/servers-command.ts index c5d8d18dc..19645cb93 100644 --- a/shared/server-commands/server/servers-command.ts +++ b/shared/server-commands/server/servers-command.ts | |||
@@ -30,10 +30,12 @@ export class ServersCommand extends AbstractCommand { | |||
30 | }) | 30 | }) |
31 | } | 31 | } |
32 | 32 | ||
33 | async cleanupTests () { | 33 | cleanupTests () { |
34 | const p: Promise<any>[] = [] | 34 | const promises: Promise<any>[] = [] |
35 | |||
36 | const saveGithubLogsIfNeeded = async () => { | ||
37 | if (!isGithubCI()) return | ||
35 | 38 | ||
36 | if (isGithubCI()) { | ||
37 | await ensureDir('artifacts') | 39 | await ensureDir('artifacts') |
38 | 40 | ||
39 | const origin = this.buildDirectory('logs/peertube.log') | 41 | const origin = this.buildDirectory('logs/peertube.log') |
@@ -44,14 +46,17 @@ export class ServersCommand extends AbstractCommand { | |||
44 | } | 46 | } |
45 | 47 | ||
46 | if (this.server.parallel) { | 48 | if (this.server.parallel) { |
47 | p.push(ServersCommand.flushTests(this.server.internalServerNumber)) | 49 | const promise = saveGithubLogsIfNeeded() |
50 | .then(() => ServersCommand.flushTests(this.server.internalServerNumber)) | ||
51 | |||
52 | promises.push(promise) | ||
48 | } | 53 | } |
49 | 54 | ||
50 | if (this.server.customConfigFile) { | 55 | if (this.server.customConfigFile) { |
51 | p.push(remove(this.server.customConfigFile)) | 56 | promises.push(remove(this.server.customConfigFile)) |
52 | } | 57 | } |
53 | 58 | ||
54 | return p | 59 | return promises |
55 | } | 60 | } |
56 | 61 | ||
57 | async waitUntilLog (str: string, count = 1, strictCount = true) { | 62 | async waitUntilLog (str: string, count = 1, strictCount = true) { |