})
}
- async cleanupTests () {
- const p: Promise<any>[] = []
+ cleanupTests () {
+ const promises: Promise<any>[] = []
+
+ const saveGithubLogsIfNeeded = async () => {
+ if (!isGithubCI()) return
- if (isGithubCI()) {
await ensureDir('artifacts')
const origin = this.buildDirectory('logs/peertube.log')
}
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) {