Skip to content

Commit 2e4f6f4

Browse files
committed
comment address
1 parent 784e448 commit 2e4f6f4

File tree

6 files changed

+46
-42
lines changed

6 files changed

+46
-42
lines changed

.github/skills/run-e2e-tests/SKILL.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Run E2E (end-to-end) tests to verify complete user workflows work correctly.
1616

1717
## Quick Reference
1818

19-
| Action | Command |
20-
| ----------------- | ------------------------------------------- |
21-
| Run all E2E tests | `npm run compile-tests && npm run e2e-test` |
22-
| Run specific test | `npm run e2e-test -- --grep "discovers"` |
23-
| Debug in VS Code | Debug panel → "E2E Tests" → F5 |
19+
| Action | Command |
20+
| ----------------- | -------------------------------------------------------------- |
21+
| Run all E2E tests | `npm run compile && npm run compile-tests && npm run e2e-test` |
22+
| Run specific test | `npm run e2e-test -- --grep "discovers"` |
23+
| Debug in VS Code | Debug panel → "E2E Tests" → F5 |
2424

2525
## How E2E Tests Work
2626

@@ -37,7 +37,7 @@ They take longer (1-3 minutes) but catch integration issues.
3737
### Step 1: Compile and Run
3838

3939
```bash
40-
npm run compile-tests && npm run e2e-test
40+
npm run compile && npm run compile-tests && npm run e2e-test
4141
```
4242

4343
### Step 2: Interpret Results
@@ -122,5 +122,4 @@ suite('E2E: [Workflow Name]', function () {
122122
- E2E tests are slower than smoke tests (expect 1-3 minutes)
123123
- They may create/modify files - cleanup happens in `suiteTeardown`
124124
- First run downloads VS Code (~100MB, cached in `.vscode-test/`)
125-
- See [docs/e2e-tests.md](../../../docs/e2e-tests.md) for detailed documentation
126-
- See [docs/test-types-comparison.md](../../../docs/test-types-comparison.md) for when to use which test type
125+
- For more details on E2E tests and how they compare to other test types, refer to the project's testing documentation.

.github/skills/run-integration-tests/SKILL.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ Run integration tests to verify that multiple components (managers, API, setting
1414

1515
## Quick Reference
1616

17-
| Action | Command |
18-
| ------------------------- | --------------------------------------------------- |
19-
| Run all integration tests | `npm run compile-tests && npm run integration-test` |
20-
| Run specific test | `npm run integration-test -- --grep "manager"` |
21-
| Debug in VS Code | Debug panel → "Integration Tests" → F5 |
17+
| Action | Command |
18+
| ------------------------- | ---------------------------------------------------------------------- |
19+
| Run all integration tests | `npm run compile && npm run compile-tests && npm run integration-test` |
20+
| Run specific test | `npm run integration-test -- --grep "manager"` |
21+
| Debug in VS Code | Debug panel → "Integration Tests" → F5 |
2222

2323
## How Integration Tests Work
2424

@@ -35,7 +35,7 @@ They're faster than E2E (which test full workflows) but more thorough than smoke
3535
### Step 1: Compile and Run
3636

3737
```bash
38-
npm run compile-tests && npm run integration-test
38+
npm run compile && npm run compile-tests && npm run integration-test
3939
```
4040

4141
### Step 2: Interpret Results
@@ -110,5 +110,3 @@ suite('Integration: [Component A] + [Component B]', function () {
110110
- Integration tests are faster than E2E (30s-2min vs 1-3min)
111111
- Focus on testing component boundaries, not full user workflows
112112
- First run downloads VS Code (~100MB, cached in `.vscode-test/`)
113-
- See [docs/integration-tests.md](../../../docs/integration-tests.md) for detailed documentation
114-
- See [docs/test-types-comparison.md](../../../docs/test-types-comparison.md) for when to use which test type

.github/skills/run-smoke-tests/SKILL.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ Run smoke tests to verify the extension loads and basic functionality works in a
1414

1515
## Quick Reference
1616

17-
| Action | Command |
18-
| ------------------- | ---------------------------------------------------- |
19-
| Run all smoke tests | `npm run compile-tests && npm run smoke-test` |
20-
| Run specific test | `npm run smoke-test -- --grep "Extension activates"` |
21-
| Debug in VS Code | Debug panel → "Smoke Tests" → F5 |
17+
| Action | Command |
18+
| ------------------- | ---------------------------------------------------------------- |
19+
| Run all smoke tests | `npm run compile && npm run compile-tests && npm run smoke-test` |
20+
| Run specific test | `npm run smoke-test -- --grep "Extension activates"` |
21+
| Debug in VS Code | Debug panel → "Smoke Tests" → F5 |
2222

2323
## How Smoke Tests Work
2424

@@ -37,7 +37,7 @@ This is why smoke tests are slower (~10-60s) but catch real integration issues.
3737
### Step 1: Compile and Run
3838

3939
```bash
40-
npm run compile-tests && npm run smoke-test
40+
npm run compile && npm run compile-tests && npm run smoke-test
4141
```
4242

4343
### Step 2: Interpret Results
@@ -124,5 +124,3 @@ suite('Smoke: [Feature Name]', function () {
124124

125125
- First run downloads VS Code (~100MB, cached in `.vscode-test/`)
126126
- Tests auto-retry once on failure
127-
- See [docs/smoke-tests.md](../../../docs/smoke-tests.md) for detailed documentation
128-
- See [docs/test-types-comparison.md](../../../docs/test-types-comparison.md) for when to use which test type

.vscode/launch.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"--extensionTestsPath=${workspaceFolder}/out/test/smoke"
5656
],
5757
"outFiles": ["${workspaceFolder}/out/**/*.js", "${workspaceFolder}/dist/**/*.js"],
58-
"preLaunchTask": "${defaultBuildTask}"
58+
"preLaunchTask": "tasks: build"
5959
},
6060
{
6161
"name": "E2E Tests",
@@ -69,7 +69,7 @@
6969
"--extensionTestsPath=${workspaceFolder}/out/test/e2e"
7070
],
7171
"outFiles": ["${workspaceFolder}/out/**/*.js", "${workspaceFolder}/dist/**/*.js"],
72-
"preLaunchTask": "${defaultBuildTask}"
72+
"preLaunchTask": "tasks: build"
7373
},
7474
{
7575
"name": "Integration Tests",
@@ -83,7 +83,7 @@
8383
"--extensionTestsPath=${workspaceFolder}/out/test/integration"
8484
],
8585
"outFiles": ["${workspaceFolder}/out/**/*.js", "${workspaceFolder}/dist/**/*.js"],
86-
"preLaunchTask": "${defaultBuildTask}"
86+
"preLaunchTask": "tasks: build"
8787
}
8888
]
8989
}

src/extension.ts

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
onDidChangeTerminalShellIntegration,
2929
withProgress,
3030
} from './common/window.apis';
31-
import { getConfiguration } from './common/workspace.apis';
31+
import { getConfiguration, getWorkspaceFolders } from './common/workspace.apis';
3232
import { createManagerReady } from './features/common/managerReady';
3333
import { AutoFindProjects } from './features/creators/autoFindProjects';
3434
import { ExistingProjects } from './features/creators/existingProjects';
@@ -101,10 +101,25 @@ export async function activate(context: ExtensionContext): Promise<PythonEnviron
101101
// When disabled, the main Python extension handles environments instead (legacy mode).
102102
const config = getConfiguration('python');
103103
const inspection = config.inspect<boolean>('useEnvironmentsExtension');
104-
const explicitlyDisabled =
105-
inspection?.globalValue === false ||
106-
inspection?.workspaceValue === false ||
107-
inspection?.workspaceFolderValue === false;
104+
105+
// Check global and workspace-level explicit disables
106+
let explicitlyDisabled = inspection?.globalValue === false || inspection?.workspaceValue === false;
107+
108+
// Also check folder-scoped settings in multi-root workspaces
109+
// (inspect() on an unscoped config won't populate workspaceFolderValue reliably)
110+
if (!explicitlyDisabled) {
111+
const workspaceFolders = getWorkspaceFolders();
112+
if (workspaceFolders) {
113+
for (const folder of workspaceFolders) {
114+
const folderConfig = getConfiguration('python', folder.uri);
115+
const folderInspection = folderConfig.inspect<boolean>('useEnvironmentsExtension');
116+
if (folderInspection?.workspaceFolderValue === false) {
117+
explicitlyDisabled = true;
118+
break;
119+
}
120+
}
121+
}
122+
}
108123

109124
const useEnvironmentsExtension = !explicitlyDisabled;
110125
traceInfo(`Experiment Status: useEnvironmentsExtension setting set to ${useEnvironmentsExtension}`);

src/test/integration/envManagerApi.integration.test.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,10 @@ suite('Integration: Environment Manager + API', function () {
8787
// Trigger a refresh which should fire events
8888
await api.refreshEnvironments(undefined);
8989

90-
// Wait a bit for events to propagate
91-
// Note: Events may or may not fire depending on whether anything changed
92-
// This test verifies the event mechanism works, not that changes occurred
93-
await new Promise((resolve) => setTimeout(resolve, 1000));
94-
95-
// If any events fired, verify they have expected shape
96-
if (handler.fired) {
97-
const event = handler.first;
98-
assert.ok(event !== undefined, 'Event should have a value');
99-
}
90+
// Assert that at least one event fired during refresh
91+
await handler.assertFiredAtLeast(1, 5000);
92+
const event = handler.first;
93+
assert.ok(event !== undefined, 'Event should have a value');
10094
} finally {
10195
handler.dispose();
10296
}

0 commit comments

Comments
 (0)