Update mock-server, upload ci logs on failure
This commit is contained in:
parent
21db47c423
commit
1d89ffcc2d
10 changed files with 83 additions and 10 deletions
|
@ -3,10 +3,14 @@
|
|||
/* eslint-disable no-await-in-loop, no-console */
|
||||
|
||||
import createDebug from 'debug';
|
||||
import fs from 'fs/promises';
|
||||
import path from 'path';
|
||||
|
||||
import { Bootstrap } from '../bootstrap';
|
||||
|
||||
export const debug = createDebug('mock:benchmarks');
|
||||
|
||||
export { Bootstrap } from '../bootstrap';
|
||||
export { Bootstrap };
|
||||
export { App } from '../playwright';
|
||||
|
||||
export type StatsType = {
|
||||
|
@ -59,6 +63,19 @@ export function stats(
|
|||
return result;
|
||||
}
|
||||
|
||||
export async function saveLogs(bootstrap: Bootstrap): Promise<void> {
|
||||
const { ARTIFACTS_DIR } = process.env;
|
||||
if (!ARTIFACTS_DIR) {
|
||||
console.error('Not saving logs. Please set ARTIFACTS_DIR env variable');
|
||||
return;
|
||||
}
|
||||
|
||||
await fs.mkdir(ARTIFACTS_DIR, { recursive: true });
|
||||
|
||||
const { logsDir } = bootstrap;
|
||||
await fs.rename(logsDir, path.join(ARTIFACTS_DIR, 'logs'));
|
||||
}
|
||||
|
||||
// Can happen if electron exits prematurely
|
||||
process.on('unhandledRejection', reason => {
|
||||
console.error('Unhandled rejection:');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue