Skip to content

initial scaffolding for e2e, smoke, integration tests#1223

Merged
eleanorjboyd merged 22 commits intomicrosoft:mainfrom
eleanorjboyd:salty-mouse
Feb 12, 2026
Merged

initial scaffolding for e2e, smoke, integration tests#1223
eleanorjboyd merged 22 commits intomicrosoft:mainfrom
eleanorjboyd:salty-mouse

Conversation

@eleanorjboyd
Copy link
Member

No description provided.

@eleanorjboyd eleanorjboyd self-assigned this Feb 11, 2026
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.
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.
@eleanorjboyd eleanorjboyd marked this pull request as ready for review February 12, 2026 17:19
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 12, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-cli labeled 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.

@eleanorjboyd eleanorjboyd merged commit dab7bc9 into microsoft:main Feb 12, 2026
64 of 65 checks passed
@eleanorjboyd eleanorjboyd deleted the salty-mouse branch February 12, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments