-
Notifications
You must be signed in to change notification settings - Fork 6k
feat: add test for EXTENSIONS_GALLERY #5432
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
Conversation
This allows yous to pass environment variables to code-server's helper when running integration tests.
This test ensures EXTENSIONS_GALLERY is read when set and using the `--install-extension` flag.
const CODE_SERVER_COMMAND = process.env.CODE_SERVER_PATH || path.resolve("../../release-standalone/bin/code-server") | ||
const { stdout, stderr } = await promisify(exec)(`${CODE_SERVER_COMMAND} ${argv.join(" ")}`) | ||
const { stdout, stderr } = await promisify(exec)(`${CODE_SERVER_COMMAND} ${argv.join(" ")}`, { |
Check warning
Code scanning / CodeQL
Shell command built from environment values
Codecov Report
@@ Coverage Diff @@
## main #5432 +/- ##
=======================================
Coverage 72.42% 72.42%
=======================================
Files 30 30
Lines 1672 1672
Branches 366 366
=======================================
Hits 1211 1211
Misses 398 398
Partials 63 63 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
const CODE_SERVER_COMMAND = process.env.CODE_SERVER_PATH || path.resolve("../../release-standalone/bin/code-server") | ||
const { stdout, stderr } = await promisify(exec)(`${CODE_SERVER_COMMAND} ${argv.join(" ")}`) | ||
const { stdout, stderr } = await promisify(exec)(`${CODE_SERVER_COMMAND} ${argv.join(" ")}`, { | ||
env: { ...process.env, ...env }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woah I did not know { ...undefined }
works. TIL.
Interestingly [ ...undefined ]
does not work. I guess that is JavaScript for you! 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL JS is teaching us new things everyday 😂
Description
This refactors our integration test helper to allow you to pass environment variables. I also add a new integration test to ensure
EXTENSIONS_GALLERY
is used when passed in.Changes
Fixes #5364