bazel test with env file

845 views
Skip to first unread message

Paul Gross

unread,
Feb 16, 2016, 8:01:49 PM2/16/16
to bazel-discuss
Is there a way to make bazel test take a .env file instead of passing the environment variables one at a time with --test_env? Something like "bazel test --test_env_file=.env //..."

Thanks,
Paul

Alex Humesky

unread,
Feb 16, 2016, 9:50:22 PM2/16/16
to Paul Gross, bazel-discuss
One way to do this is to create a config in bazel.rc:

test:myenv --test_env=... --test_env=... --test_env=...

then do bazel test --config=myenv :mytest

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CAMXKpGAwuSOmJVwyUGD%3DO-vJOQ5HLXMSiZPRE4FfP9B9egDejA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Paul Gross

unread,
Feb 17, 2016, 11:37:59 AM2/17/16
to Alex Humesky, bazel-discuss
That's an interesting idea, but my main hope is to be able to use the same .env file that I use for other stuff. It's semi-standard and a bunch of tools know how to read an .env file.

Thanks,
Paul

Thiago Farina

unread,
Feb 18, 2016, 4:07:30 PM2/18/16
to Paul Gross, bazel-discuss
On Wed, Feb 17, 2016 at 2:37 PM, Paul Gross <pgr...@gmail.com> wrote:
That's an interesting idea, but my main hope is to be able to use the same .env file that I use for other stuff. It's semi-standard and a bunch of tools know how to read an .env file.

That seems interesting. Is there a bug filed for this? If not, maybe would be good to file one to keep
track of this feature request?

-- 
Thiago Farina

Paul Gross

unread,
Feb 22, 2016, 11:46:17 AM2/22/16
to Thiago Farina, bazel-discuss
Reply all
Reply to author
Forward
0 new messages