diff --git a/package.json b/package.json index e3b4709e7..ed07e855a 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "build": "npx lerna run build", "build:changed": "npx lerna run build --since main", "test": "npm run ui-test --workspace=extester-test", - "coverage": "npm run test -- -- --coverage", + "test:coverage": "npm run test -- -- --coverage", "test:build": "npm run build && npm install --workspace=extester-test && npm test" }, "workspaces": [ diff --git a/packages/extester/src/browser.ts b/packages/extester/src/browser.ts index 681cf2713..40973eb4d 100644 --- a/packages/extester/src/browser.ts +++ b/packages/extester/src/browser.ts @@ -15,7 +15,6 @@ export class VSBrowser { static readonly browserName = 'vscode'; private storagePath: string; private extensionsFolder: string | undefined; - private extensionDevelopmentPath: string | undefined; private customSettings: Object; private _driver!: WebDriver; private codeVersion: string; @@ -26,7 +25,6 @@ export class VSBrowser { constructor(codeVersion: string, releaseType: ReleaseQuality, customSettings: Object = {}, logLevel: logging.Level = logging.Level.INFO) { this.storagePath = process.env.TEST_RESOURCES ? process.env.TEST_RESOURCES : path.resolve(DEFAULT_STORAGE_FOLDER); this.extensionsFolder = process.env.EXTENSIONS_FOLDER ? process.env.EXTENSIONS_FOLDER : undefined; - this.extensionDevelopmentPath = process.env.EXTENSION_DEV_PATH ? process.env.EXTENSION_DEV_PATH : undefined; this.customSettings = customSettings; this.codeVersion = codeVersion; this.releaseType = releaseType; @@ -78,8 +76,8 @@ export class VSBrowser { fs.copyFileSync(path.resolve(__dirname, '..', '..', 'resources', 'state.vscdb'), path.join(userSettings, 'globalStorage', 'state.vscdb')); } args.push(`--extensionDevelopmentPath=${process.cwd()}`); - } else if(this.extensionDevelopmentPath) { - args.push(`--extensionDevelopmentPath=${this.extensionDevelopmentPath}`); + } else if(process.env.EXTENSION_DEV_PATH) { + args.push(`--extensionDevelopmentPath=${process.env.EXTENSION_DEV_PATH}`); } let options = new Options().setChromeBinaryPath(codePath).addArguments(...args) as any; diff --git a/packages/extester/src/util/codeUtil.ts b/packages/extester/src/util/codeUtil.ts index fc0e47b73..69a518702 100644 --- a/packages/extester/src/util/codeUtil.ts +++ b/packages/extester/src/util/codeUtil.ts @@ -28,8 +28,6 @@ export interface RunOptions { logLevel?: logging.Level; /** try to perform all setup without internet connection, needs all requirements pre-downloaded manually */ offline?: boolean; - /** path to unbundled extension sources */ - extensionDevelopmentPath?: string; /** list of resources to be opened by VS Code */ resources: string[]; } @@ -57,7 +55,6 @@ export class CodeUtil { private cliEnv!: string; private availableVersions: string[]; private extensionsFolder: string | undefined; - private extensionDevelopmentPath: string | undefined; private coverage: boolean | undefined; /** @@ -73,11 +70,6 @@ export class CodeUtil { this.coverage = coverage; this.releaseType = type; - // If code coverage is enabled, set extensionDevelopmentPath to the current directory. - if (this.coverage) { - this.extensionDevelopmentPath = path.resolve("."); - } - if (type === ReleaseQuality.Stable) { this.codeFolder = path.join(this.downloadFolder, (process.platform === 'darwin') ? 'Visual Studio Code.app' : `VSCode-${this.downloadPlatform}`); @@ -267,7 +259,7 @@ export class CodeUtil { process.env = finalEnv; process.env.TEST_RESOURCES = this.downloadFolder; process.env.EXTENSIONS_FOLDER = this.extensionsFolder; - process.env.EXTENSION_DEV_PATH = this.extensionDevelopmentPath; + process.env.EXTENSION_DEV_PATH = this.coverage ? process.cwd() : undefined; const runner = new VSRunner(this.executablePath, literalVersion, this.parseSettings(runOptions.settings ?? DEFAULT_RUN_OPTIONS.settings), runOptions.cleanup, this.releaseType, runOptions.config); return await runner.runTests(testFilesPattern, this, runOptions.logLevel, runOptions.resources); }