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
Edit: I downgraded to v 0.6.0 and worked like a charm. So definitely something messed up my projects in the new release:
Prior to the latest extension update all my tests used to behave correctly, they would grab my user's environment variables (i'm on windows 7, 64 bits) whenever I explicitly wanted to (i.e. System.get("MYSQL_FFMA_JDBCURL").
After the extension update, I cannot get my user environment variables anymore (debug only, works normal), but when i want to run or debug a test, no matter how y call them, i'll always get a null.
I read in the changelog that now it supports configuring the env variables via the launch.test.json.
I gave it a shot and configured my env in launch.test.json, like this:
...
"env": {"a":"a"},
...
But after launchig it the problem is still there, my app can't grab any custom environment variable:
I tried everything from reinstalling the Extension pack, to restarting the machine.
I don't know if there's something i'm missing in my config, but i swear it worked without any problems yesterday.
Also, I noticed the Test Explorer disapeared.
Steps to reproduce:
-Create new project with unit test (i use the maven extension).
-Add a user environment variable.
-Restart vscode.
-At any rate in the test call the env var like this System.getenv("VARIABLE_NAME")
-Try to debug the test, and step over until we can monitor the variable's value.
-It should be null.
-Configure the test adding the env variable.
-Try to debug the test, and step over until we can monitor the variable's value.
-It should be null.
Test explorer has been moved to test view container.
I suppose you triggered the test directly from the codelens Run Test? Configuring env variables only works by triggering Run Test with config, which is only visible in the context menu of the test explorer(we kind of removed it from codelens as it make the codelens too long)
You mentioned you used to work, how did you set your env variables? Did you set it manually outside the test run or some way else?
@flakobatako I figured out that we have a bug that kind of ignores the environment variables set by process, but before I fix it , you could try the Run with config command.
Edit: I downgraded to v 0.6.0 and worked like a charm. So definitely something messed up my projects in the new release:
Prior to the latest extension update all my tests used to behave correctly, they would grab my user's environment variables (i'm on windows 7, 64 bits) whenever I explicitly wanted to (i.e. System.get("MYSQL_FFMA_JDBCURL").
After the extension update, I cannot get my user environment variables anymore (debug only, works normal), but when i want to run or debug a test, no matter how y call them, i'll always get a null.
I read in the changelog that now it supports configuring the env variables via the launch.test.json.
I gave it a shot and configured my env in launch.test.json, like this:
...
"env": {"a":"a"},
...
But after launchig it the problem is still there, my app can't grab any custom environment variable:
I tried everything from reinstalling the Extension pack, to restarting the machine.
I don't know if there's something i'm missing in my config, but i swear it worked without any problems yesterday.
Also, I noticed the Test Explorer disapeared.
Steps to reproduce:
-Create new project with unit test (i use the maven extension).
-Add a user environment variable.
-Restart vscode.
-At any rate in the test call the env var like this System.getenv("VARIABLE_NAME")
-Try to debug the test, and step over until we can monitor the variable's value.
-It should be null.
-Configure the test adding the env variable.
-Try to debug the test, and step over until we can monitor the variable's value.
-It should be null.
These are the contents of my launch.test.json
{
"run": {
"default": "",
"items": [
{
"name": "app-ffma-setAppointment",
"projectName": "app-ffma-setAppointment",
"workingDirectory": "c:\Git\Work\Java\gdev-FieldServices\Lambdas\app-ffma-setAppointment",
"args": [],
"vmargs": [],
"env": {
"a": "aaaa"
},
"preLaunchTask": ""
}
]
},
"debug": {
"default": "",
"items": [
{
"name": "app-ffma-setAppointment",
"projectName": "app-ffma-setAppointment",
"workingDirectory": "c:\Git\Work\Java\gdev-FieldServices\Lambdas\app-ffma-setAppointment",
"args": [],
"vmargs": [],
"env": {
"a": "aaaa"
},
"preLaunchTask": ""
}
]
}
}
Thank you in advance.
The text was updated successfully, but these errors were encountered: