initial scaffolding for e2e, smoke, integration tests#1223
Merged
eleanorjboyd merged 22 commits intomicrosoft:mainfrom Feb 12, 2026
Merged
initial scaffolding for e2e, smoke, integration tests#1223eleanorjboyd merged 22 commits intomicrosoft:mainfrom
eleanorjboyd merged 22 commits intomicrosoft:mainfrom
Conversation
The smoke/e2e/integration tests were failing because VS Code wasn't reading the settings.json file we created. This happened because @vscode/test-cli uses its own default user-data directory unless we explicitly pass --user-data-dir. This fix adds launchArgs to each test profile to point to our .vscode-test/user-data directory where CI creates the settings file with 'python.useEnvironmentsExtension': true.
The python.useEnvironmentsExtension setting is defined by ms-python.python which isn't installed during tests. Instead of polluting the python.* namespace by defining the setting ourselves, we check for test environment variables (VSC_PYTHON_SMOKE_TEST, VSC_PYTHON_E2E_TEST, VSC_PYTHON_INTEGRATION_TEST) and skip the setting check when running tests.
The previous code used config.get() which may return defaultValue from other extensions' package.json (like ms-python.python setting useEnvironmentsExtension to false) even when those extensions aren't installed. Now we use inspect() to check if the setting has been explicitly set by the user (globalValue, workspaceValue, or workspaceFolderValue). If not explicitly set, we default to true, allowing the extension to activate properly in test environments and clean VS Code instances.
Previous logic used config.get() which was affected by defaultValue from other extensions' package.json. Now we use inspect() to check if the user has EXPLICITLY set useEnvironmentsExtension to false. - If user sets to true: activate - If user sets to false: don't activate - If user doesn't set anything: activate (default behavior) - If only defaultValue exists: ignored, activate anyway This is more robust and matches user intent.
22e9790 to
a2f18cf
Compare
The extension's main entry point is dist/extension.js which requires webpack to build. The test CI jobs were only running tsc (compile-tests) but not webpack (compile), so the extension code wasn't being built and tests were running against stale/missing code. Also simplified the useEnvironmentsExtension check to only skip activation when explicitly set to false by the user.
Now that we use inspect() for useEnvironmentsExtension check, the default value from Python extension's package.json is ignored. This lets us safely install ms-python.python which bundles the pet binary needed for native Python environment discovery.
The config property may be less reliable than the CLI flag for installing extensions before running tests.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an initial end-to-end testing scaffold (smoke, integration, and e2e) for the extension, along with local debug configs and CI workflows to run these suites in a real VS Code instance.
Changes:
- Introduces smoke/integration/e2e test suites + shared test utilities for polling/retries and event capture.
- Adds
@vscode/test-clilabeled configurations, npm scripts, and VS Code launch configurations to run/debug the new suites. - Updates CI workflows to execute the new suites across OS/Python matrices, and adjusts activation logic to ignore non-user defaults for
python.useEnvironmentsExtension.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/testUtils.ts | Adds common async test helpers (sleep/polling/retry) and an event capture utility. |
| src/test/smoke/index.ts | Adds smoke-test runner entry point. |
| src/test/smoke/activation.smoke.test.ts | Adds smoke coverage for extension presence, activation, exports, and command registration. |
| src/test/integration/index.ts | Adds integration-test runner entry point. |
| src/test/integration/envManagerApi.integration.test.ts | Adds integration coverage for API/manager interactions and basic structural checks. |
| src/test/e2e/index.ts | Adds e2e-test runner entry point. |
| src/test/e2e/environmentDiscovery.e2e.test.ts | Adds e2e coverage for environment discovery via the extension API. |
| src/test/constants.ts | Adds test constants and environment-variable based test type detection. |
| src/extension.ts | Changes activation gating to only honor explicit user disables via inspect(). |
| package.json | Adds npm scripts to run smoke/e2e/integration suites via vscode-test. |
| .vscode/launch.json | Adds launch configs for smoke/e2e/integration debugging in VS Code. |
| .vscode-test.mjs | Switches to labeled @vscode/test-cli configs for multiple test suites + shared launch args/env. |
| .github/workflows/push-check.yml | Adds smoke/e2e/integration jobs to push CI. |
| .github/workflows/pr-check.yml | Adds smoke/e2e/integration jobs to PR CI. |
| .github/skills/run-smoke-tests/SKILL.md | Documents how to run smoke tests locally and in CI. |
| .github/skills/run-integration-tests/SKILL.md | Documents how to run integration tests locally and in CI. |
| .github/skills/run-e2e-tests/SKILL.md | Documents how to run e2e tests locally and in CI. |
| .github/skills/debug-failing-test/SKILL.md | Adds a “debug failing test” workflow doc. |
| .github/instructions/generic.instructions.md | Adds guidance for settings checks, path comparisons, and test build prerequisites. |
meganrogge
approved these changes
Feb 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.