Skip to content
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

Test: "initializeCommand" in devcontainer.json #2407

Closed
2 tasks done
chrmarti opened this issue Feb 23, 2020 · 7 comments
Closed
2 tasks done

Test: "initializeCommand" in devcontainer.json #2407

chrmarti opened this issue Feb 23, 2020 · 7 comments
Labels
testplan-item Test plan item/assignments for upcoming release
Milestone

Comments

@chrmarti
Copy link
Contributor

chrmarti commented Feb 23, 2020

Refs: #1045

Complexity: 3


On setting up DevContainers for testing: https://github.com/microsoft/vscode-remote-containers/blob/master/CONTRIBUTING.md#testing-remote-containers

"initializeCommand" in the devcontainer.json is an optional property that can be set to a string (run in a shell) or an array of strings (run without shell). Verify:

  • This always runs first when starting / connecting to a DevContainer.
  • Case 1: One of: Single-container (image or Dockerfile) or docker-compose.
  • Case 2: Repository container when the container does not exist yet or is rebuilt.
    • Check the command runs before the Docker image is built (note that there is an auxiliary image built first, the command runs only after that, but before the user image is built).
  • Case 3: Repository container when the container already exists.

The working directory of the command should be the workspace folder. Except with the repository container, the command runs locally on the host OS.

@chrmarti chrmarti added the testplan-item Test plan item/assignments for upcoming release label Feb 23, 2020
@chrmarti chrmarti added this to the February 2020 milestone Feb 23, 2020
@bpasero
Copy link
Member

bpasero commented Feb 25, 2020

I verified that a config such as "initializeCommand": "yarn" gets run when I open a folder in docker on Windows.

I am not sure I understand the Case 1-2-3 matrix you ask for and I am also not skilled enough in remote containers to know how to set this up (I appreciate how this docs gave me a good step by step description).

Are there docs for how to setup the other cases?

@bpasero bpasero added the verification-steps-needed Steps to verify are needed for verification label Feb 25, 2020
@chrmarti
Copy link
Contributor Author

@bpasero

Case 1 is really just https://github.com/microsoft/vscode-remote-containers/blob/master/CONTRIBUTING.md#single-container-with-dockerfile-or-image. It sounds like you already did that.

Case 2 and 3 is https://github.com/microsoft/vscode-remote-containers/blob/master/CONTRIBUTING.md#repository-container with:

  • Case 2: Make sure the container does not exist yet or rebuild it. (Just one of the two.)
  • Case 3: Make sure the container already exists and connect to it.
  • Run Remote-Containers: Show Log to inspect the current log and check your command was run in both cases.

@chrmarti chrmarti removed the verification-steps-needed Steps to verify are needed for verification label Feb 25, 2020
@bpasero
Copy link
Member

bpasero commented Feb 25, 2020

@chrmarti ok. any reason that command is not in the default commands list?

image

@chrmarti
Copy link
Contributor Author

@bpasero The command is there when you are not connected to a remote already.

@mjbvz
Copy link

mjbvz commented Feb 26, 2020

I tested on MacOS. Ran into a few hiccups but seems to work overall

@sbatten
Copy link
Member

sbatten commented Feb 26, 2020

Blocked by the above issue.

@chrmarti chrmarti assigned egamma and unassigned sbatten Feb 27, 2020
@egamma egamma removed their assignment Feb 27, 2020
@egamma
Copy link
Member

egamma commented Feb 27, 2020

Verified that the blocking issue on Windows is resolved.
Covered cases 1, 2, 3.

@egamma egamma closed this as completed Feb 27, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
testplan-item Test plan item/assignments for upcoming release
Projects
None yet
Development

No branches or pull requests

5 participants