From ad928a4e0f971de8ce34ca8beb1cef09a79a880a Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Wed, 19 Jan 2022 18:08:04 +0100 Subject: [PATCH] adopt server script in integration tests --- test/automation/src/playwrightDriver.ts | 3 ++- test/integration/browser/src/index.ts | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/automation/src/playwrightDriver.ts b/test/automation/src/playwrightDriver.ts index d7da0ec9f3f..56c1d6de871 100644 --- a/test/automation/src/playwrightDriver.ts +++ b/test/automation/src/playwrightDriver.ts @@ -229,7 +229,8 @@ async function launchServer(options: LaunchOptions) { let serverLocation: string | undefined; if (codeServerPath) { - serverLocation = join(codeServerPath, `server.${process.platform === 'win32' ? 'cmd' : 'sh'}`); + const { serverApplicationName } = require(join(codeServerPath, 'product.json')); + serverLocation = join(codeServerPath, 'bin', `${serverApplicationName}${process.platform === 'win32' ? '.cmd' : ''}`); args.push(`--logsPath=${logsPath}`); logger.log(`Starting built server from '${serverLocation}'`); diff --git a/test/integration/browser/src/index.ts b/test/integration/browser/src/index.ts index 818aaae5418..5116646ddae 100644 --- a/test/integration/browser/src/index.ts +++ b/test/integration/browser/src/index.ts @@ -5,6 +5,7 @@ import * as path from 'path'; import * as cp from 'child_process'; +import { promises as fs } from 'fs'; import * as playwright from '@playwright/test'; import * as url from 'url'; import * as tmp from 'tmp'; @@ -130,7 +131,8 @@ async function launchServer(browserType: BrowserType): Promise<{ endpoint: url.U 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'}`); + 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) {