Skip to content

Commit 994c41b

Browse files
Kartik Rajwesm
Kartik Raj
authored andcommitted
Fix terminal activation tests (microsoft/vscode-python#18406)
* Lets begin * Print envsPath.json * More logging * Oops * Skip all tests * lets try this * Done investigating * Fix test * Skip python2 tests for pipenv
1 parent 1a8f6ae commit 994c41b

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

extensions/positron-python/src/test/common/terminals/environmentActivationProviders/terminalActivation.testvirtualenvs.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import { FileSystem } from '../../../../client/common/platform/fileSystem';
1212
import { PYTHON_VIRTUAL_ENVS_LOCATION } from '../../../ciConstants';
1313
import {
1414
PYTHON_PATH,
15-
resetGlobalInterpreterPathSetting,
16-
setGlobalInterpreterPath,
15+
restorePythonPathInWorkspaceRoot,
16+
setPythonPathInWorkspaceRoot,
1717
updateSetting,
1818
waitForCondition,
1919
} from '../../../common';
@@ -107,7 +107,7 @@ suite('Activation of Environments in Terminal', () => {
107107
vscode.ConfigurationTarget.Global,
108108
);
109109
await pythonSettings.update('condaPath', undefined, vscode.ConfigurationTarget.Global);
110-
await resetGlobalInterpreterPathSetting();
110+
await restorePythonPathInWorkspaceRoot();
111111
}
112112

113113
/**
@@ -148,7 +148,7 @@ suite('Activation of Environments in Terminal', () => {
148148
vscode.workspace.workspaceFolders![0].uri,
149149
vscode.ConfigurationTarget.WorkspaceFolder,
150150
);
151-
await setGlobalInterpreterPath(envPath);
151+
await setPythonPathInWorkspaceRoot(envPath);
152152
const content = await openTerminalAndAwaitCommandContent(waitTimeForActivation, file, outputFile, 5_000);
153153
expect(fileSystem.arePathsSame(content, envPath)).to.equal(true, 'Environment not activated');
154154
}
@@ -168,22 +168,18 @@ suite('Activation of Environments in Terminal', () => {
168168
if (process.env.CI_PYTHON_VERSION && process.env.CI_PYTHON_VERSION.startsWith('2.')) {
169169
this.skip();
170170
}
171-
// https://github.com/microsoft/vscode-python/issues/17666
172-
this.skip();
173171
await testActivation(envPaths.venvPath);
174172
});
175173
test('Should activate with pipenv', async function () {
176-
// https://github.com/microsoft/vscode-python/issues/17666
177-
this.skip();
174+
if (process.env.CI_PYTHON_VERSION && process.env.CI_PYTHON_VERSION.startsWith('2.')) {
175+
this.skip();
176+
}
178177
await testActivation(envPaths.pipenvPath);
179178
});
180179
test('Should activate with virtualenv', async function () {
181-
// https://github.com/microsoft/vscode-python/issues/17666
182-
this.skip();
183180
await testActivation(envPaths.virtualEnvPath);
184181
});
185182
test('Should activate with conda', async function () {
186-
this.skip();
187183
// Powershell does not work with conda by default, hence use cmd.
188184
await terminalSettings.update(
189185
'integrated.defaultProfile.windows',

0 commit comments

Comments
 (0)