mirror of
https://github.com/Microsoft/vscode
synced 2024-10-06 03:17:00 +00:00
add remote server cli test
This commit is contained in:
parent
866c0160d4
commit
0ecd7f72d8
|
@ -0,0 +1,22 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'mocha';
|
||||
import * as assert from 'assert';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
suite('vscode server cli', () => {
|
||||
|
||||
const extension = process.env.TESTRESOLVER_INSTALL_BUILTIN_EXTENSION;
|
||||
const skip = !process.env.BUILD_SOURCEVERSION // Skip it when running out of sources
|
||||
|| !process.env.REMOTE_VSCODE // Skip it when not a remote integration test
|
||||
|| !extension // Skip it when extension is not provided to server
|
||||
;
|
||||
|
||||
(skip ? test.skip : test)('extension is installed and enabled when installed by server cli', function () {
|
||||
assert.ok(vscode.extensions.getExtension(extension!));
|
||||
});
|
||||
|
||||
});
|
|
@ -83,12 +83,6 @@ export function activate(context: vscode.ExtensionContext) {
|
|||
const env = getNewEnv();
|
||||
const remoteDataDir = process.env['TESTRESOLVER_DATA_FOLDER'] || path.join(os.homedir(), serverDataFolderName || `${dataFolderName}-testresolver`);
|
||||
|
||||
const remoteExtension = process.env['TESTRESOLVER_REMOTE_EXTENSION'];
|
||||
if (remoteExtension) {
|
||||
commandArgs.push('--install-extension', remoteExtension);
|
||||
commandArgs.push('--start-server');
|
||||
}
|
||||
|
||||
env['VSCODE_AGENT_FOLDER'] = remoteDataDir;
|
||||
outputChannel.appendLine(`Using data folder at ${remoteDataDir}`);
|
||||
|
||||
|
@ -98,6 +92,11 @@ export function activate(context: vscode.ExtensionContext) {
|
|||
const serverCommandPath = path.join(vscodePath, 'resources', 'server', 'bin-dev', serverCommand);
|
||||
extHostProcess = cp.spawn(serverCommandPath, commandArgs, { env, cwd: vscodePath });
|
||||
} else {
|
||||
const extensionToInstall = process.env['TESTRESOLVER_INSTALL_BUILTIN_EXTENSION'];
|
||||
if (extensionToInstall) {
|
||||
commandArgs.push('--install-builtin-extension', extensionToInstall);
|
||||
commandArgs.push('--start-server');
|
||||
}
|
||||
const serverCommand = process.platform === 'win32' ? 'server.cmd' : 'server.sh';
|
||||
let serverLocation = env['VSCODE_REMOTE_SERVER_PATH']; // support environment variable to specify location of server on disk
|
||||
if (!serverLocation) {
|
||||
|
|
Loading…
Reference in a new issue