Skip to content

Commit

Permalink
Updates based on review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
TamiTakamiya committed Apr 10, 2024
1 parent 46bfbf2 commit 7e3ee49
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
6 changes: 2 additions & 4 deletions packages/extester/src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 1 addition & 9 deletions packages/extester/src/util/codeUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
}
Expand Down Expand Up @@ -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;

/**
Expand All @@ -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}`);
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 7e3ee49

Please sign in to comment.