Skip to content

Commit ad928a4

Browse files
committed
adopt server script in integration tests
1 parent ca8d9d1 commit ad928a4

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

test/automation/src/playwrightDriver.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ async function launchServer(options: LaunchOptions) {
229229

230230
let serverLocation: string | undefined;
231231
if (codeServerPath) {
232-
serverLocation = join(codeServerPath, `server.${process.platform === 'win32' ? 'cmd' : 'sh'}`);
232+
const { serverApplicationName } = require(join(codeServerPath, 'product.json'));
233+
serverLocation = join(codeServerPath, 'bin', `${serverApplicationName}${process.platform === 'win32' ? '.cmd' : ''}`);
233234
args.push(`--logsPath=${logsPath}`);
234235

235236
logger.log(`Starting built server from '${serverLocation}'`);

test/integration/browser/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import * as path from 'path';
77
import * as cp from 'child_process';
8+
import { promises as fs } from 'fs';
89
import * as playwright from '@playwright/test';
910
import * as url from 'url';
1011
import * as tmp from 'tmp';
@@ -130,7 +131,8 @@ async function launchServer(browserType: BrowserType): Promise<{ endpoint: url.U
130131

131132
let serverLocation: string;
132133
if (process.env.VSCODE_REMOTE_SERVER_PATH) {
133-
serverLocation = path.join(process.env.VSCODE_REMOTE_SERVER_PATH, `server.${process.platform === 'win32' ? 'cmd' : 'sh'}`);
134+
const { serverApplicationName } = require(path.join(process.env.VSCODE_REMOTE_SERVER_PATH, 'product.json'));
135+
serverLocation = path.join(process.env.VSCODE_REMOTE_SERVER_PATH, 'bin', `${serverApplicationName}${process.platform === 'win32' ? '.cmd' : ''}`);
134136
serverArgs.push(`--logsPath=${logsPath}`);
135137

136138
if (optimist.argv.debug) {

0 commit comments

Comments
 (0)