adopt --server-data-dir

This commit is contained in:
Martin Aeschlimann
2022-01-21 12:11:47 +01:00
parent 8047f9c877
commit f9cac7c28a
6 changed files with 20 additions and 26 deletions

View File

@@ -118,7 +118,6 @@ async function launchServer(browserType: BrowserType): Promise<{ endpoint: url.U
const userDataDir = path.join(testDataPath, 'd');
const env = {
VSCODE_AGENT_FOLDER: userDataDir,
VSCODE_BROWSER: browserType,
...process.env
};
@@ -126,29 +125,28 @@ async function launchServer(browserType: BrowserType): Promise<{ endpoint: url.U
const root = path.join(__dirname, '..', '..', '..', '..');
const logsPath = path.join(root, '.build', 'logs', 'integration-tests-browser');
const serverArgs = ['--browser', 'none', '--driver', 'web', '--enable-proposed-api', '--disable-telemetry'];
const serverArgs = ['--driver', 'web', '--enable-proposed-api', '--disable-telemetry', '--server-data-dir', userDataDir];
let serverLocation: string;
if (process.env.VSCODE_REMOTE_SERVER_PATH) {
const { serverApplicationName } = require(path.join(process.env.VSCODE_REMOTE_SERVER_PATH, 'product.json'));
serverLocation = path.join(process.env.VSCODE_REMOTE_SERVER_PATH, 'bin', `${serverApplicationName}${process.platform === 'win32' ? '.cmd' : ''}`);
serverArgs.push(`--logsPath=${logsPath}`);
if (optimist.argv.debug) {
console.log(`Starting built server from '${serverLocation}'`);
console.log(`Storing log files into '${logsPath}'`);
}
} else {
serverLocation = path.join(root, `scripts/code-server.${process.platform === 'win32' ? 'bat' : 'sh'}`);
serverArgs.push('--logsPath', logsPath);
process.env.VSCODE_DEV = '1';
if (optimist.argv.debug) {
console.log(`Starting server out of sources from '${serverLocation}'`);
console.log(`Storing log files into '${logsPath}'`);
}
}
console.log(`Storing log files into '${logsPath}'`);
serverArgs.push('--logsPath', logsPath);
const stdio: cp.StdioOptions = optimist.argv.debug ? 'pipe' : ['ignore', 'pipe', 'ignore'];
let serverProcess = cp.spawn(