-
Notifications
You must be signed in to change notification settings - Fork 37
initial scaffolding for e2e, smoke, integration tests #1223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
eleanorjboyd
wants to merge
16
commits into
microsoft:main
Choose a base branch
from
eleanorjboyd:salty-mouse
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
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.
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.