Skip to content

Commit

Permalink
Fix terminal activation tests (#18406)
Browse files Browse the repository at this point in the history
* Lets begin

* Print envsPath.json

* More logging

* Oops

* Skip all tests

* lets try this

* Done investigating

* Fix test

* Skip python2 tests for pipenv
  • Loading branch information
Kartik Raj authored Feb 1, 2022
1 parent db8f997 commit a91af7b
Showing 1 changed file with 7 additions and 11 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 @@ -107,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 @@ -148,7 +148,7 @@ suite('Activation of Environments in Terminal', () => {
vscode.workspace.workspaceFolders![0].uri,
vscode.ConfigurationTarget.WorkspaceFolder,
);
await setGlobalInterpreterPath(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 @@ -168,22 +168,18 @@ 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();
if (process.env.CI_PYTHON_VERSION && process.env.CI_PYTHON_VERSION.startsWith('2.')) {
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 a91af7b

Please sign in to comment.