Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartik Raj committed Feb 1, 2022
1 parent adb226c commit 753a52f
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { FileSystem } from '../../../../client/common/platform/fileSystem';
import { PYTHON_VIRTUAL_ENVS_LOCATION } from '../../../ciConstants';
import {
PYTHON_PATH,
resetGlobalInterpreterPathSetting,
setGlobalInterpreterPath,
restorePythonPathInWorkspaceRoot,
setPythonPathInWorkspaceRoot,
updateSetting,
waitForCondition,
} from '../../../common';
Expand Down Expand Up @@ -56,7 +56,6 @@ suite('Activation of Environments in Terminal', () => {
const sandbox = sinon.createSandbox();
suiteSetup(async () => {
envPaths = await fs.readJson(envsLocation);
console.log('Beginning suite', envPaths);
terminalSettings = vscode.workspace.getConfiguration('terminal', vscode.workspace.workspaceFolders![0].uri);
pythonSettings = vscode.workspace.getConfiguration('python', vscode.workspace.workspaceFolders![0].uri);
defaultShell.Windows = terminalSettings.inspect('integrated.defaultProfile.windows').globalValue;
Expand Down Expand Up @@ -108,7 +107,7 @@ suite('Activation of Environments in Terminal', () => {
vscode.ConfigurationTarget.Global,
);
await pythonSettings.update('condaPath', undefined, vscode.ConfigurationTarget.Global);
await resetGlobalInterpreterPathSetting();
await restorePythonPathInWorkspaceRoot();
}

/**
Expand Down Expand Up @@ -149,9 +148,7 @@ suite('Activation of Environments in Terminal', () => {
vscode.workspace.workspaceFolders![0].uri,
vscode.ConfigurationTarget.WorkspaceFolder,
);
console.log('Setting workspace default interpreter path', envPath);
await setGlobalInterpreterPath(envPath);
console.log('Finished setting workspace default interpreter path', envPath);
await setPythonPathInWorkspaceRoot(envPath);
const content = await openTerminalAndAwaitCommandContent(waitTimeForActivation, file, outputFile, 5_000);
expect(fileSystem.arePathsSame(content, envPath)).to.equal(true, 'Environment not activated');
}
Expand All @@ -171,15 +168,22 @@ suite('Activation of Environments in Terminal', () => {
if (process.env.CI_PYTHON_VERSION && process.env.CI_PYTHON_VERSION.startsWith('2.')) {
this.skip();
}
// https://github.com/microsoft/vscode-python/issues/17666
this.skip();
await testActivation(envPaths.venvPath);
});
test('Should activate with pipenv', async function () {
// https://github.com/microsoft/vscode-python/issues/17666
this.skip();
await testActivation(envPaths.pipenvPath);
});
test('Should activate with virtualenv', async function () {
// https://github.com/microsoft/vscode-python/issues/17666
this.skip();
await testActivation(envPaths.virtualEnvPath);
});
test('Should activate with conda', async function () {
this.skip();
// Powershell does not work with conda by default, hence use cmd.
await terminalSettings.update(
'integrated.defaultProfile.windows',
Expand Down

0 comments on commit 753a52f

Please sign in to comment.