question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFC: passing environment variables to go_test

See original GitHub issue

Some Go tests need to read some environment variables to load a different set of configurations for test environment. There is no way to pass environment variables to Go tests.

We may need to implement a env parameter to go_test, just like java_test.

An alternative may be making --test-runner-env of buck test available for Go. It is currently only available for Apple tests.

@mkaczanowski @nemith @styurin @philipjameson @bobyangyf @LLITCHEV What do you think?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
linzhpcommented, Jan 19, 2019

Tested it. It works. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

RFC 1408 - IETF
Abstract This document specifies a mechanism for passing environment ... RFC 1408 Telnet Environment Option January 1993 PRINTER This variable is used to ......
Read more >
How to pass values to RFC while testing - SAP Community
I have created a RFC .where importing parameter is a table .Now when i am trying to test RFC in tcode se37 i.e...
Read more >
env - Go Packages
Package env provides functions to test code that read environment variables or the current working directory.
Read more >
Using environment variables in Go tests - YellowDuck.be
When you want to set an environment variable in a Go test, you can use the os.Setenv function. If you have multiple tests, ......
Read more >
Set environment variable for Go tests - Stack Overflow
FOO=BAR bash -c 'go list ./... | grep -v vendor | xargs -n1 go test -timeout=3s'. A good explanation why the original command...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found