Skip to content
Draft
Show file tree
Hide file tree
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
54 changes: 52 additions & 2 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.12', '3.14']
python-version: ['3.10', '3.12', '3.14']

steps:
- name: Checkout
Expand Down Expand Up @@ -268,7 +268,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.12', '3.14']
python-version: ['3.10', '3.12', '3.14']

steps:
- name: Checkout
Expand Down Expand Up @@ -352,3 +352,53 @@ jobs:
- name: Run Integration Tests (non-Linux)
if: runner.os != 'Linux'
run: npm run integration-test

integration-tests-multiroot:
name: Integration Tests (Multi-Root)
runs-on: ${{ matrix.os }}
needs: [smoke-tests]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.12', '3.14']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Dependencies
run: npm ci

- name: Compile Extension
run: npm run compile

- name: Compile Tests
run: npm run compile-tests

- name: Configure Test Settings
run: |
mkdir -p .vscode-test/user-data/User
echo '{"python.useEnvironmentsExtension": true}' > .vscode-test/user-data/User/settings.json
shell: bash

- name: Run Integration Tests Multi-Root (Linux)
if: runner.os == 'Linux'
uses: GabrielBB/xvfb-action@v1
with:
run: npm run integration-test-multiroot

- name: Run Integration Tests Multi-Root (non-Linux)
if: runner.os != 'Linux'
run: npm run integration-test-multiroot
135 changes: 132 additions & 3 deletions .github/workflows/push-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,55 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.12', '3.14']
python-version: ['3.10', '3.12', '3.14']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Checkout Python Environment Tools
uses: actions/checkout@v4
with:
repository: 'microsoft/python-environment-tools'
path: 'python-env-tools-src'
sparse-checkout: |
crates
Cargo.toml
Cargo.lock
sparse-checkout-cone-mode: false

- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache Rust build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
python-env-tools-src/target
key: ${{ runner.os }}-cargo-pet-${{ hashFiles('python-env-tools-src/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-pet-

- name: Build Python Environment Tools
run: cargo build --release --package pet
working-directory: python-env-tools-src

- name: Copy pet binary (Unix)
if: runner.os != 'Windows'
run: |
mkdir -p python-env-tools/bin
cp python-env-tools-src/target/release/pet python-env-tools/bin/
chmod +x python-env-tools/bin/pet

- name: Copy pet binary (Windows)
if: runner.os == 'Windows'
run: |
mkdir -p python-env-tools/bin
cp python-env-tools-src/target/release/pet.exe python-env-tools/bin/
shell: bash

- name: Install Node
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -133,12 +176,55 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.12', '3.14']
python-version: ['3.10', '3.12', '3.14']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Checkout Python Environment Tools
uses: actions/checkout@v4
with:
repository: 'microsoft/python-environment-tools'
path: 'python-env-tools-src'
sparse-checkout: |
crates
Cargo.toml
Cargo.lock
sparse-checkout-cone-mode: false

- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache Rust build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
python-env-tools-src/target
key: ${{ runner.os }}-cargo-pet-${{ hashFiles('python-env-tools-src/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-pet-

- name: Build Python Environment Tools
run: cargo build --release --package pet
working-directory: python-env-tools-src

- name: Copy pet binary (Unix)
if: runner.os != 'Windows'
run: |
mkdir -p python-env-tools/bin
cp python-env-tools-src/target/release/pet python-env-tools/bin/
chmod +x python-env-tools/bin/pet

- name: Copy pet binary (Windows)
if: runner.os == 'Windows'
run: |
mkdir -p python-env-tools/bin
cp python-env-tools-src/target/release/pet.exe python-env-tools/bin/
shell: bash

- name: Install Node
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -183,12 +269,55 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.12', '3.14']
python-version: ['3.10', '3.12', '3.14']

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Checkout Python Environment Tools
uses: actions/checkout@v4
with:
repository: 'microsoft/python-environment-tools'
path: 'python-env-tools-src'
sparse-checkout: |
crates
Cargo.toml
Cargo.lock
sparse-checkout-cone-mode: false

- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache Rust build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
python-env-tools-src/target
key: ${{ runner.os }}-cargo-pet-${{ hashFiles('python-env-tools-src/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-pet-

- name: Build Python Environment Tools
run: cargo build --release --package pet
working-directory: python-env-tools-src

- name: Copy pet binary (Unix)
if: runner.os != 'Windows'
run: |
mkdir -p python-env-tools/bin
cp python-env-tools-src/target/release/pet python-env-tools/bin/
chmod +x python-env-tools/bin/pet

- name: Copy pet binary (Windows)
if: runner.os == 'Windows'
run: |
mkdir -p python-env-tools/bin
cp python-env-tools-src/target/release/pet.exe python-env-tools/bin/
shell: bash

- name: Install Node
uses: actions/setup-node@v4
with:
Expand Down
20 changes: 19 additions & 1 deletion .vscode-test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export default defineConfig([
},
{
label: 'integrationTests',
files: 'out/test/integration/**/*.integration.test.js',
files: 'out/test/integration/*.integration.test.js',
workspaceFolder: 'src/test/integration/test-workspace/project-a',
mocha: {
ui: 'tdd',
timeout: 60000,
Expand All @@ -61,6 +62,23 @@ export default defineConfig([
// the native Python tools (pet binary). We use inspect() for
// useEnvironmentsExtension check, so Python extension's default is ignored.
},
{
label: 'integrationTestsMultiRoot',
files: 'out/test/integration/multiroot/*.integration.test.js',
workspaceFolder: 'src/test/integration/test-workspace/integration-tests.code-workspace',
mocha: {
ui: 'tdd',
timeout: 60000,
retries: 1,
},
env: {
VSC_PYTHON_INTEGRATION_TEST: '1',
},
launchArgs: [
`--user-data-dir=${userDataDir}`,
'--disable-workspace-trust',
],
},
{
label: 'extensionTests',
files: 'out/test/**/*.test.js',
Expand Down
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@
"python-envs.pythonProjects": [],
"git.branchRandomName.enable": true,
"git.branchProtection": ["main"],
"git.branchProtectionPrompt": "alwaysCommitToNewBranch"
"git.branchProtectionPrompt": "alwaysCommitToNewBranch",
"chat.tools.terminal.autoApprove": {
"npx tsc": true,
"mkdir": true
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@
"smoke-test": "vscode-test --label smokeTests",
"e2e-test": "vscode-test --label e2eTests --install-extensions ms-python.python",
"integration-test": "vscode-test --label integrationTests --install-extensions ms-python.python",
"integration-test-multiroot": "vscode-test --label integrationTestsMultiRoot --install-extensions ms-python.python",
"vsce-package": "vsce package -o ms-python-envs-insiders.vsix"
},
"devDependencies": {
Expand Down
Loading
Loading