Skip to content

Commit 33e8098

Browse files
authored
Add integration test (#1227)
1 parent 7a04501 commit 33e8098

21 files changed

+2439
-173
lines changed

.github/workflows/pr-check.yml

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ jobs:
175175
fail-fast: false
176176
matrix:
177177
os: [ubuntu-latest, windows-latest, macos-latest]
178-
python-version: ['3.9', '3.12', '3.14']
178+
python-version: ['3.10', '3.12', '3.14']
179179

180180
steps:
181181
- name: Checkout
@@ -268,7 +268,7 @@ jobs:
268268
fail-fast: false
269269
matrix:
270270
os: [ubuntu-latest, windows-latest, macos-latest]
271-
python-version: ['3.9', '3.12', '3.14']
271+
python-version: ['3.10', '3.12', '3.14']
272272

273273
steps:
274274
- name: Checkout
@@ -352,3 +352,53 @@ jobs:
352352
- name: Run Integration Tests (non-Linux)
353353
if: runner.os != 'Linux'
354354
run: npm run integration-test
355+
356+
integration-tests-multiroot:
357+
name: Integration Tests (Multi-Root)
358+
runs-on: ${{ matrix.os }}
359+
needs: [smoke-tests]
360+
strategy:
361+
fail-fast: false
362+
matrix:
363+
os: [ubuntu-latest, windows-latest, macos-latest]
364+
python-version: ['3.10', '3.12', '3.14']
365+
366+
steps:
367+
- name: Checkout
368+
uses: actions/checkout@v4
369+
370+
- name: Install Node
371+
uses: actions/setup-node@v4
372+
with:
373+
node-version: ${{ env.NODE_VERSION }}
374+
cache: 'npm'
375+
376+
- name: Install Python
377+
uses: actions/setup-python@v5
378+
with:
379+
python-version: ${{ matrix.python-version }}
380+
381+
- name: Install Dependencies
382+
run: npm ci
383+
384+
- name: Compile Extension
385+
run: npm run compile
386+
387+
- name: Compile Tests
388+
run: npm run compile-tests
389+
390+
- name: Configure Test Settings
391+
run: |
392+
mkdir -p .vscode-test/user-data/User
393+
echo '{"python.useEnvironmentsExtension": true}' > .vscode-test/user-data/User/settings.json
394+
shell: bash
395+
396+
- name: Run Integration Tests Multi-Root (Linux)
397+
if: runner.os == 'Linux'
398+
uses: GabrielBB/xvfb-action@v1
399+
with:
400+
run: npm run integration-test-multiroot
401+
402+
- name: Run Integration Tests Multi-Root (non-Linux)
403+
if: runner.os != 'Linux'
404+
run: npm run integration-test-multiroot

.github/workflows/push-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
fail-fast: false
8484
matrix:
8585
os: [ubuntu-latest, windows-latest, macos-latest]
86-
python-version: ['3.9', '3.12', '3.14']
86+
python-version: ['3.10', '3.12', '3.14']
8787

8888
steps:
8989
- name: Checkout
@@ -176,7 +176,7 @@ jobs:
176176
fail-fast: false
177177
matrix:
178178
os: [ubuntu-latest, windows-latest, macos-latest]
179-
python-version: ['3.9', '3.12', '3.14']
179+
python-version: ['3.10', '3.12', '3.14']
180180

181181
steps:
182182
- name: Checkout
@@ -269,7 +269,7 @@ jobs:
269269
fail-fast: false
270270
matrix:
271271
os: [ubuntu-latest, windows-latest, macos-latest]
272-
python-version: ['3.9', '3.12', '3.14']
272+
python-version: ['3.10', '3.12', '3.14']
273273

274274
steps:
275275
- name: Checkout

.vscode-test.mjs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ export default defineConfig([
4545
},
4646
{
4747
label: 'integrationTests',
48-
files: 'out/test/integration/**/*.integration.test.js',
48+
files: 'out/test/integration/*.integration.test.js',
49+
workspaceFolder: 'src/test/integration/test-workspace/project-a',
4950
mocha: {
5051
ui: 'tdd',
5152
timeout: 60000,
@@ -61,6 +62,23 @@ export default defineConfig([
6162
// the native Python tools (pet binary). We use inspect() for
6263
// useEnvironmentsExtension check, so Python extension's default is ignored.
6364
},
65+
{
66+
label: 'integrationTestsMultiRoot',
67+
files: 'out/test/integration/multiroot/*.integration.test.js',
68+
workspaceFolder: 'src/test/integration/test-workspace/integration-tests.code-workspace',
69+
mocha: {
70+
ui: 'tdd',
71+
timeout: 60000,
72+
retries: 1,
73+
},
74+
env: {
75+
VSC_PYTHON_INTEGRATION_TEST: '1',
76+
},
77+
launchArgs: [
78+
`--user-data-dir=${userDataDir}`,
79+
'--disable-workspace-trust',
80+
],
81+
},
6482
{
6583
label: 'extensionTests',
6684
files: 'out/test/**/*.test.js',

.vscode/settings.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@
2626
},
2727
"prettier.tabWidth": 4,
2828
"python-envs.defaultEnvManager": "ms-python.python:venv",
29-
"python-envs.pythonProjects": [],
3029
"git.branchRandomName.enable": true,
3130
"git.branchProtection": ["main"],
32-
"git.branchProtectionPrompt": "alwaysCommitToNewBranch"
31+
"git.branchProtectionPrompt": "alwaysCommitToNewBranch",
32+
"chat.tools.terminal.autoApprove": {
33+
"npx tsc": true,
34+
"mkdir": true
35+
}
3336
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,7 @@
685685
"smoke-test": "vscode-test --label smokeTests",
686686
"e2e-test": "vscode-test --label e2eTests --install-extensions ms-python.python",
687687
"integration-test": "vscode-test --label integrationTests --install-extensions ms-python.python",
688+
"integration-test-multiroot": "vscode-test --label integrationTestsMultiRoot --install-extensions ms-python.python",
688689
"vsce-package": "vsce package -o ms-python-envs-insiders.vsix"
689690
},
690691
"devDependencies": {

0 commit comments

Comments
 (0)