Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix terminal activation tests #18406

Merged
merged 9 commits into from
Feb 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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