-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Allow to setup env variables specific to tests. #172
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
Comments
you can create a file named Here are the instructions:
os.getenv("VARIABLE1") |
From @eMerzh on September 22, 2017 6:50 Thanks for your reply :) but with this method i can't make the distinction between tests and dev env ? or can i ? |
No you can't. |
From @eMerzh on September 22, 2017 20:19 ok :/ that was the whole point of this issue.... |
@eMerzh apologies for not understanding the issue clearly and closing it prematurely. Will look into this. |
From @eMerzh on September 24, 2017 11:55 @DonJayamanne no problem... probably my fault too not being explicit enough... Thank you for your help :) |
Could possibly be resolve with changes in #1128 |
From @eMerzh on October 19, 2017 20:3 @DonJayamanne are you sure you linked the correct issue ? π€ |
From @asfaltboy on November 2, 2017 13:10 @DonJayamanne I'm sorely missing this feature. Would a PR for this be appreciated? I'm new to VSCode extension development, but it seems by looking at the code, this could be relatively simple to fix. This is what I had in mind:
Alternatively, we could also hard-code the two settings (envFile and testEnvFile) and call Please let me know if you'd like to see this sort of change, or you have something else in mind. |
@asfaltboy Next month VS Code will be releasing a new feature which would allow opening multiple folders in the same workspace, this would allow you to have different settings for different folders (provided they are opened as workspaces). I believe this would give you what you need. I.e. lets wait for around 2 weeks untill the next release of VS Code and catch up then. |
@asfaltboy with the current release of VS Code you can now create a separate workspace folder for your unit tests. This will allow you to have separate env environments for the unit tests. |
@DonJayamanne can you please point us to the docs regarding "create a separate workspace folder"? What does it mean in practice, that users need to switch out to another workspace to run tests and then switch back to develop? |
@asfaltboy , please check the latest version of VS Code for details on multi-root workspace folders |
I'm closing this as it has been over a month since we requested more info. If we do get the info at a later date we can re-open this issue. |
I realize this has been closed, but wanted to inquire: am I understanding correctly that multi-root workspace folders would mean having to duplicate my checked out copy of my code? If so that's extremely cumbersome. Right now as a workaround I create a shell task to run my tests & then just have the command source a file before running the command. Ie something like:
which works, but feels clunky and also means I give up the ability to debug my tests from VS Code. As an alternative to get breakpoints & debugability, I created a launch config in launch.json:
which works, but doesn't integrate with the normal VS Code "Run Tests" stuff. What would be really nice is a setting like |
@pzelnip multi-root workspaces are for working with multiple directories as if they are a single project, so I'm not sure why you think you need to check out your code multiple times? If you're after a way of defining a |
From the screencap on the supplied link (https://code.visualstudio.com/updates/v1_18#_support-for-multi-root-workspaces) it looked like multi-root implied multiple folders, apologies if I misinterpreted. In any case, #332 sounds exactly like what I have in mind, thanks! |
From @eMerzh on August 30, 2017 9:33
Hi thanks for your project π ,
in my app i use Env var to select the configuration.
So to select the correct configuration in the test i was looking for a way to put Env variable via vscode or smth.
Copied from original issue: DonJayamanne/pythonVSCode#1184
The text was updated successfully, but these errors were encountered: