Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Setting environment variables for tests causes output to cease #1608

Closed
mattgen88 opened this issue Apr 5, 2018 · 5 comments
Closed

Setting environment variables for tests causes output to cease #1608

mattgen88 opened this issue Apr 5, 2018 · 5 comments

Comments

@mattgen88
Copy link

Steps to Reproduce:

  1. Open a test file for a go program
  2. Open configuration
  3. set go.testEnvVars to have an environment variable, e.g. {"TEST": 1}
  4. Switch to a test and click run test
  5. Observe that no output was produced in the output window
  6. Set go.testEnvVars back to {}
  7. Switch to a test and click run test
  8. Observe output was produced in the output window

Expected result:
The clicked test should execute, with the environment variables output before the test execution, so that the programmer knows that the test was executed and done so with the specified environment.

Reason:
I use an environment variable to trigger an integration suite of tests. I wish to execute the test suite the same as any other test by setting the environment variable within my configuration.

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Apr 9, 2018

Looks like this is a problem when the value of the env var is not a string. I have pushed a fix. Until I ship an update, you can try the below:

@mattgen88
Copy link
Author

Many thanks! I'll give it a shot tomorrow. Thanks for the quick response!

@ramya-rao-a
Copy link
Contributor

PS: you will have to be on VS Code 1.22 to get the fix

@mattgen88
Copy link
Author

Confirmed working in vscode 1.22.1

Thank you once again!

@ramya-rao-a
Copy link
Contributor

This bug fix is now out in the latest update to the Go extension (0.6.79)
Thanks for reporting @mattgen88!

@vscodebot vscodebot bot locked and limited conversation to collaborators May 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants