X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fserver-commands%2Fserver%2Fservers-command.ts;h=19645cb93a1eae15e82389a9ff4a014d4b351024;hb=813f37438a1043876defb442c0b3eade198b3ca2;hp=c5d8d18dcf10b9026277e1a378dbdffc412c60b8;hpb=3318147300b4f998adf728eb0a5a14a4c1829c51;p=github%2FChocobozzz%2FPeerTube.git 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 { }) } - async cleanupTests () { - const p: Promise[] = [] + cleanupTests () { + const promises: Promise[] = [] + + const saveGithubLogsIfNeeded = async () => { + if (!isGithubCI()) return - if (isGithubCI()) { await ensureDir('artifacts') const origin = this.buildDirectory('logs/peertube.log') @@ -44,14 +46,17 @@ export class ServersCommand extends AbstractCommand { } if (this.server.parallel) { - p.push(ServersCommand.flushTests(this.server.internalServerNumber)) + const promise = saveGithubLogsIfNeeded() + .then(() => ServersCommand.flushTests(this.server.internalServerNumber)) + + promises.push(promise) } if (this.server.customConfigFile) { - p.push(remove(this.server.customConfigFile)) + promises.push(remove(this.server.customConfigFile)) } - return p + return promises } async waitUntilLog (str: string, count = 1, strictCount = true) {