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

Selecting testcase with docker compose in windows #419

Closed
haraldwalnum opened this issue Apr 27, 2022 · 5 comments
Closed

Selecting testcase with docker compose in windows #419

haraldwalnum opened this issue Apr 27, 2022 · 5 comments

Comments

@haraldwalnum
Copy link

haraldwalnum commented Apr 27, 2022

I have struggled quite a bit with selecting testscases when using docker-compose in windows. Originally, I was not able to use the setx command to select testcases. I selected whatever was in the .env file.
As I understand, the setx command sets the env. variable at user level :https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/setx
I think the .env file overwrites this.

At a later stage I had trouble setting the testcase also in the .env file. It turned out that (for some reason I dont't know) the evn. variable TESTCASE had been set at shell level. This overwrites what in the .env file https://docs.docker.com/compose/environment-variables/
My solution was to use:
> ($env:TESTCASE="<testcase_directory") -and (docker-compose up)
instead of:
> (setx TESTCASE "<testcase_dir_name>") -and (docker-compose up)

$env sets the env. variable at shell level for the current session only.

To me this seems to be a safer approach.
@JavierArroyoBastida I know you have tested a bit with Windows and PowerShell. Have you experienced something similar?

@javiarrobas
Copy link
Contributor

@haraldwalnum pity that it's proving so challenging. I have no extensive experience with docker-compose in Windows since I recently changed laptop. All experience I have is reported here, which is the issue that led to using the command that did not work for you. That is:

> (setx TESTCASE "<testcase_dir_name>") -and (docker-compose up)

@dhblum it's maybe worth editing the README for substituting the command with the one suggested by @haraldwalnum, or maybe keeping both indicating that the second one can be used if there is any trouble.

@dhblum
Copy link
Collaborator

dhblum commented Apr 27, 2022

Thanks @haraldwalnum for reporting and also proposing the solution. A similar issue was reported to me offline and I'm seeing if this solution can help that too. Can you also just verify your proposed solution doesn't require a > after testcase_directory?

@dhblum
Copy link
Collaborator

dhblum commented Apr 27, 2022

Confirming the fix works for the offline case I got as well.

@haraldwalnum
Copy link
Author

Thanks @haraldwalnum for reporting and also proposing the solution. A similar issue was reported to me offline and I'm seeing if this solution can help that too. Can you also just verify your proposed solution doesn't require a > after testcase_directory?

the missing > is a typo from my side. Should be:
> ($env:TESTCASE="<testcase_directory>") -and (docker-compose up) or as an example:
> ($env:TESTCASE="singlezone_commercial_hydronic") -and (docker-compose up)

@dhblum dhblum closed this as completed in bc29a6a Apr 27, 2022
@dhblum
Copy link
Collaborator

dhblum commented Apr 27, 2022

Closed by #420.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants