mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
Produce logs during test runs (integration, smoke) and publish as artefacts (#126065)
* first cut upload log files from integration test runs * always publish log files * move logs into integration-tests folder * also produce logs for smoke tests * store remote log files * wire in logspath arg properly * always publish logs * enable logs for browser based smoke tests * log only in verbose
This commit is contained in:
@@ -92,27 +92,35 @@ async function launchServer(browserType: BrowserType): Promise<{ endpoint: url.U
|
||||
...process.env
|
||||
};
|
||||
|
||||
const root = path.join(__dirname, '..', '..', '..', '..');
|
||||
const logsPath = path.join(root, '.build', 'logs', 'integration-tests-browser');
|
||||
|
||||
const serverArgs = ['--browser', 'none', '--driver', 'web', '--enable-proposed-api'];
|
||||
|
||||
let serverLocation: string;
|
||||
if (process.env.VSCODE_REMOTE_SERVER_PATH) {
|
||||
serverLocation = path.join(process.env.VSCODE_REMOTE_SERVER_PATH, `server.${process.platform === 'win32' ? 'cmd' : 'sh'}`);
|
||||
serverArgs.push(`--logsPath=${logsPath}`);
|
||||
|
||||
console.log(`Starting built server from '${serverLocation}'`);
|
||||
console.log(`Storing log files into '${logsPath}'`);
|
||||
} else {
|
||||
serverLocation = path.join(__dirname, '..', '..', '..', '..', `resources/server/web.${process.platform === 'win32' ? 'bat' : 'sh'}`);
|
||||
serverLocation = path.join(root, `resources/server/web.${process.platform === 'win32' ? 'bat' : 'sh'}`);
|
||||
serverArgs.push('--logsPath', logsPath);
|
||||
process.env.VSCODE_DEV = '1';
|
||||
|
||||
console.log(`Starting server out of sources from '${serverLocation}'`);
|
||||
console.log(`Storing log files into '${logsPath}'`);
|
||||
}
|
||||
|
||||
let serverProcess = cp.spawn(
|
||||
serverLocation,
|
||||
['--browser', 'none', '--driver', 'web', '--enable-proposed-api'],
|
||||
serverArgs,
|
||||
{ env }
|
||||
);
|
||||
|
||||
serverProcess?.stderr?.on('data', error => console.log(`Server stderr: ${error}`));
|
||||
|
||||
if (optimist.argv.debug) {
|
||||
serverProcess?.stderr?.on('data', error => console.log(`Server stderr: ${error}`));
|
||||
serverProcess?.stdout?.on('data', data => console.log(`Server stdout: ${data}`));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user