aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--shared/server-commands/server/servers-command.ts17
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) {