Skip to content

Commit

Permalink
Initialize shell
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Jul 11, 2019
1 parent f1dfff7 commit 7a8413f
Showing 1 changed file with 10 additions and 3 deletions.
Expand Up @@ -142,12 +142,19 @@ suite('Activation of Environments in Terminal', () => {
consoleInitWaitMs: number,
pythonFile: string,
logFile: string,
logFileCreationWaitMs: number
logFileCreationWaitMs: number,
condaExecutable = 'conda'
): Promise<string> {
const terminal = vscode.window.createTerminal();
terminal.show();
await sleep(consoleInitWaitMs);
terminal.sendText(`python ${pythonFile} ${logFile}`, true);
terminal.sendText(`${condaExecutable || 'conda'} init`, true);
await sleep(consoleInitWaitMs);
await sleep(consoleInitWaitMs);
const terminal2 = vscode.window.createTerminal();
terminal2.show();
await sleep(consoleInitWaitMs);
terminal2.sendText(`python ${pythonFile} ${logFile}`, true);
await waitForCondition(() => fs.pathExists(logFile), logFileCreationWaitMs, `${logFile} file not created.`);

return fs.readFile(logFile, 'utf-8');
Expand Down Expand Up @@ -190,7 +197,7 @@ suite('Activation of Environments in Terminal', () => {

await updateSetting('terminal.activateEnvironment', true, vscode.workspace.workspaceFolders![0].uri, vscode.ConfigurationTarget.WorkspaceFolder);
await setPythonPathInWorkspaceRoot(envPaths.condaPath);
const content = await openTerminalAndAwaitCommandContent(waitTimeForActivation, file, outputFile, 5_000);
const content = await openTerminalAndAwaitCommandContent(waitTimeForActivation, file, outputFile, 5_000, envPaths.condaExecPath);
expect(fileSystem.arePathsSame(content, envPaths.condaPath)).to.equal(true, 'Environment not activated');

// await terminalSettings.update('integrated.shell.windows', 'C:\\Windows\\System32\\cmd.exe', vscode.ConfigurationTarget.Global);
Expand Down

0 comments on commit 7a8413f

Please sign in to comment.