Repository navigation
fix(codeUtil): keep a user-supplied EXTENSION_DEV_PATH when coverage is off - #2584
Merged
djelinek merged 2 commits intoOct 22, 2026
Merged
Conversation
…is off
`runTests()` deleted `EXTENSION_DEV_PATH` whenever coverage was disabled:
if (this.coverage) {
process.env.EXTENSION_DEV_PATH = process.cwd();
} else {
delete process.env.EXTENSION_DEV_PATH;
}
`EXTENSION_DEV_PATH` is a documented environment variable that makes ExTester
launch VS Code with `--extensionDevelopmentPath`, so the deletion silently
dropped that argument for every non-coverage run and a user-supplied path had no
effect. It is why `extest run-tests` could not run tests against a compiled
extension instead of an installed `.vsix`.
The environment preparation now lives in `applyExtensionDevPath()`, which only
writes the variable when coverage is enabled and otherwise leaves the caller's
value untouched. `extest setup-and-run --coverage` still wins, because that run
instruments the extension in the working directory.
Closes redhat-developer#2023
Signed-off-by: haigou-web <haigou@users.noreply.github.com>
|
djelinek
approved these changes
Oct 22, 2026
Collaborator
|
Thank you for your contribution! |
|
Thanks for the fix. |
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.



Closes #2023
Problem
CodeUtil.runTests()deletedEXTENSION_DEV_PATHwhenever coverage was off:EXTENSION_DEV_PATHis documented inguides/test-setup.mdas a supported environment variable, and it is the only thing that makesVSBrowseradd--extensionDevelopmentPathto the launch arguments. Deleting it meant a value the caller had exported never reached VS Code, soextest run-testscould not run tests against a compiled extension — the commands the extension contributes were simply absent, as reported in the issue.Fix
The environment preparation moved into
applyExtensionDevPath(), which writes the variable only when coverage is enabled and otherwise leaves the caller's value untouched:extest setup-and-run --coveragekeeps winning, because in that mode the instrumented extension really is the one in the working directory.Tests
Five unit tests in
codeUtil.test.tscover the new function:Full unit suite:
157 passing, 2 pendingvianpx tsc -p ./ && npx mocha 'out/test/**/*.test.js'.Docs
guides/test-setup.mdnow says the variable is honoured on every run and that--coverageoverrides it, instead of leaving that conflict implicit.Notes for reviewers
npm run test:build) — it needs a real VS Code plus ChromeDriver. The change only affects the environment handed to the runner, and the unit tests exercise it directly.EXTENSION_DEV_PATHhas exactly one reader (VSBrowser), so dropping thedeletecannot affect other code paths.packages/extester'sbuildscript runschmod a+x ./out/cli.js, which does not exist on Windows, sonpm run buildfails there even on a clean checkout.