microsoft / microsoft/vscode-test-cli

installExtensions has no effect when running in WSL

Open
#48 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
53
Forks
16
Avg merge
10h 57m
Merged PRs (30d)
2

Description

I am writing an extension test suite which requires the python extension to be installed.

I have set installExtensions: ['ms-python.vscode-pylance', 'ms-python.vscode-pylance', 'ms-python.python'] in .vscode-test.mjs, but they do not get installed.

My setup is to run VSCode on windows and connect to my ubuntu WSL install. I am also using a dev container (which is running as the root user inside a rootless docker). I suspect that this issue has more to do with WSL than the dev container, but it could be either or both.

If I edit the desktop.mjs from @vscode/test-cli to add more logging, I can see that it runs the following:

/workspaces/myplugin/.vscode-test/vscode-linux-x64-1.90.1/bin/code --extensions-dir=/workspaces/myplugin/.vscode-test/extensions --user-data-dir=/workspaces/myplugin/.vscode-test/user-data --install-extension ms-python.vscode-pylance --install-extension ms-python.python
Ignoring option 'extensions-dir': not supported for code.
Ignoring option 'user-data-dir': not supported for code.
Installing extensions on Dev Container: Devcontainer @ rootless...
Extension 'ms-python.vscode-pylance' v2024.6.1 is already installed. Use '--force' option to update to latest version or provide '@<version>' to install a specific version, for example: 'ms-python.vscode-pylance@1.2.3'.
Extension 'ms-python.python' v2024.8.1 is already installed. Use '--force' option to update to latest version or provide '@<version>' to install a specific version, for example: 'ms-python.python@1.2.3'.

The command exits with code 0, so the output is never shown.

I have worked around it by adding the following code .vscode-test.mjs:

import { env } from 'process';
delete env['VSCODE_IPC_HOOK_CLI'];
env['DONT_PROMPT_WSL_INSTALL'] = 'TRUE';

After which the plugins get installed correctly, but it seems to me that this should work without needing to fiddle with env vars.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the installExtensions handling in desktop.mjs and the .vscode-test.mjs configuration shown in the report. Reproduce the command in the described WSL and dev-container setup, then inspect how VSCODE_IPC_HOOK_CLI, DONT_PROMPT_WSL_INSTALL, and the command's exit code affect installation. Done means extensions install without manual environment changes and failures are visible.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, devtools, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.