Skip to content

Commit d593f7c

Browse files
committed
fix: seed test settings.json from .vscode-test.mjs
Move the python.useEnvironmentsExtension=true seed into the test config so local 'npm run smoke-test' / e2e / integration runs match CI. Without it the extension short-circuits during activation and registration tests fail. Drops the duplicated CI step and helper.
1 parent 8e00522 commit d593f7c

4 files changed

Lines changed: 11 additions & 41 deletions

File tree

.github/workflows/pr-check.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,6 @@ jobs:
151151
- name: Compile Tests
152152
run: npm run compile-tests
153153

154-
- name: Configure Test Settings
155-
run: node build/setup-test-user-data.mjs
156-
157154
- name: Run Smoke Tests (Linux)
158155
if: runner.os == 'Linux'
159156
uses: GabrielBB/xvfb-action@v1
@@ -241,9 +238,6 @@ jobs:
241238
- name: Compile Tests
242239
run: npm run compile-tests
243240

244-
- name: Configure Test Settings
245-
run: node build/setup-test-user-data.mjs
246-
247241
- name: Run E2E Tests (Linux)
248242
if: runner.os == 'Linux'
249243
uses: GabrielBB/xvfb-action@v1
@@ -331,9 +325,6 @@ jobs:
331325
- name: Compile Tests
332326
run: npm run compile-tests
333327

334-
- name: Configure Test Settings
335-
run: node build/setup-test-user-data.mjs
336-
337328
- name: Run Integration Tests (Linux)
338329
if: runner.os == 'Linux'
339330
uses: GabrielBB/xvfb-action@v1
@@ -378,9 +369,6 @@ jobs:
378369
- name: Compile Tests
379370
run: npm run compile-tests
380371

381-
- name: Configure Test Settings
382-
run: node build/setup-test-user-data.mjs
383-
384372
- name: Run Integration Tests Multi-Root (Linux)
385373
if: runner.os == 'Linux'
386374
uses: GabrielBB/xvfb-action@v1

.github/workflows/push-check.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,6 @@ jobs:
152152
- name: Compile Tests
153153
run: npm run compile-tests
154154

155-
- name: Configure Test Settings
156-
run: node build/setup-test-user-data.mjs
157-
158155
- name: Run Smoke Tests (Linux)
159156
if: runner.os == 'Linux'
160157
uses: GabrielBB/xvfb-action@v1
@@ -242,9 +239,6 @@ jobs:
242239
- name: Compile Tests
243240
run: npm run compile-tests
244241

245-
- name: Configure Test Settings
246-
run: node build/setup-test-user-data.mjs
247-
248242
- name: Run E2E Tests (Linux)
249243
if: runner.os == 'Linux'
250244
uses: GabrielBB/xvfb-action@v1
@@ -332,9 +326,6 @@ jobs:
332326
- name: Compile Tests
333327
run: npm run compile-tests
334328

335-
- name: Configure Test Settings
336-
run: node build/setup-test-user-data.mjs
337-
338329
- name: Run Integration Tests (Linux)
339330
if: runner.os == 'Linux'
340331
uses: GabrielBB/xvfb-action@v1

.vscode-test.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
import { defineConfig } from '@vscode/test-cli';
2+
import * as fs from 'fs';
23
import * as os from 'os';
34
import * as path from 'path';
45

56
// Keep this path short: macOS caps Unix-domain socket paths at 103 chars and
67
// VS Code creates `<userDataDir>/<x.y>-main.sock`. An in-workspace location
78
// (e.g. /Users/runner/work/<repo>/<repo>/.vscode-test/user-data) overflows.
8-
// Must match build/setup-test-user-data.mjs.
99
const userDataDir = path.join(os.tmpdir(), 'vsct-ud');
1010

11+
// Seed user settings.json so the extension actually activates: without
12+
// `python.useEnvironmentsExtension=true` it short-circuits during activation
13+
// and the smoke/e2e/integration tests see no registered managers.
14+
const userDir = path.join(userDataDir, 'User');
15+
fs.mkdirSync(userDir, { recursive: true });
16+
fs.writeFileSync(
17+
path.join(userDir, 'settings.json'),
18+
JSON.stringify({ 'python.useEnvironmentsExtension': true }) + '\n',
19+
);
20+
1121
export default defineConfig([
1222
{
1323
label: 'smokeTests',

build/setup-test-user-data.mjs

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)