Skip to content

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

Merged
merged 3 commits into from
Aug 9, 2022
Merged

feat: add test for EXTENSIONS_GALLERY #5432

merged 3 commits into from
Aug 9, 2022

Conversation

jsjoeio
Copy link
Contributor

@jsjoeio jsjoeio commented Aug 9, 2022

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

  • refactor: add env arg to runCodeServerCommand
  • feat: add EXTENSIONS_GALLERY integration test

Fixes #5364

jsjoeio added 2 commits August 9, 2022 11:52
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.
@jsjoeio jsjoeio requested a review from a team August 9, 2022 18:54
@jsjoeio jsjoeio self-assigned this Aug 9, 2022
@jsjoeio jsjoeio added the testing Anything related to testing label Aug 9, 2022
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

This shell command depends on an uncontrolled [absolute path](1). This shell command depends on an uncontrolled [absolute path](2).
@jsjoeio jsjoeio temporarily deployed to npm August 9, 2022 18:59 Inactive
@github-actions
Copy link

github-actions bot commented Aug 9, 2022

✨ code-server dev build published to npm for PR #5432!

  • Last publish status: success
  • Commit: 63ff141

To install in a local project, run:

npm install @coder/code-server-pr@5432

To install globally, run:

npm install -g @coder/code-server-pr@5432

@codecov
Copy link

codecov bot commented Aug 9, 2022

Codecov Report

Merging #5432 (63ff141) into main (a51c941) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a51c941...63ff141. Read the comment docs.

Copy link
Member

@code-asher code-asher left a 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 },
Copy link
Member

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! 😆

Copy link
Contributor Author

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 😂

@jsjoeio jsjoeio enabled auto-merge (squash) August 9, 2022 19:04
@jsjoeio jsjoeio disabled auto-merge August 9, 2022 20:17
@repo-ranger repo-ranger bot temporarily deployed to npm August 9, 2022 20:22 Inactive
@repo-ranger repo-ranger bot merged commit 11b2ef9 into main Aug 9, 2022
@repo-ranger repo-ranger bot deleted the jsjoeio/5364 branch August 9, 2022 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Anything related to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Chore]: add integration test for EXTENSIONS_GALLERY
2 participants