You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
how to specify a system environment for junit test in vscode #354
unfortunately, it does not work.
I have following in my launch.test.json: "debug": { "default": "", "items": [ { "name": "integration-tests", "projectName": "integration-tests", "workingDirectory": "<some dir>", "args": [], "vmargs": [], "env": { "MYENV": "why abc" }, "preLaunchTask": "" } ] }
With this, when I evaluate following in the code: final String configPath= System.getenv( "MYENV" );
I got nothing.
Works for me so long as the configuration is run, by either explicitly picking it from the test explorer OR setting the default parameter to the name of the configuration you want to be the default.
Sheng Chen (@jdneo) Hi Sure. I will try to put a simple project on github shortly. At the same time, I just tried, didn't work for me. will send out the project once I setup.
Sheng Chen (@jdneo) Hi I tried again, this time, I can't reproduce the problem. I think my problem could related to my uncleaned workplace cache. will close this issue.
Activity
jdneo commentedon Oct 26, 2018
yong9900
If you right click the tests you want to trigger in the test explorer and select test
Run With Config. Will this work for you?yong9900 commentedon Oct 26, 2018
unfortunately, it does not work.
I have following in my launch.test.json:
"debug": { "default": "", "items": [ { "name": "integration-tests", "projectName": "integration-tests", "workingDirectory": "<some dir>", "args": [], "vmargs": [], "env": { "MYENV": "why abc" }, "preLaunchTask": "" } ] }With this, when I evaluate following in the code:
final String configPath= System.getenv( "MYENV" );I got nothing.
yong9900 commentedon Oct 26, 2018
I actually did a thorough test. realized several things:
At this point, I suspect there is a bug in the java tester extension that does not honor env property in launch.test.json
chuckb commentedon Nov 1, 2018
Works for me so long as the configuration is run, by either explicitly picking it from the test explorer OR setting the default parameter to the name of the configuration you want to be the default.
jdneo commentedon Nov 9, 2018
yong9900 Would you mind sharing a sample project which can repro your issue?
yong9900 commentedon Nov 9, 2018
Sheng Chen (@jdneo) Hi Sure. I will try to put a simple project on github shortly. At the same time, I just tried, didn't work for me. will send out the project once I setup.
yong9900 commentedon Nov 10, 2018
Sheng Chen (@jdneo) Hi I tried again, this time, I can't reproduce the problem. I think my problem could related to my uncleaned workplace cache. will close this issue.