-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow env file with "bazel test" #955
Comments
I think this sounds like a nice feature request. It would probably have to be implemented in StandaloneTestStrategy. @ulfjack Do you think this is reasonable? If yes, I'd like to assign this to @hermione521 or @meteorcloudy. |
What features does .env support? What charset does it use? Does it require unescaping (i.e., can you escape newline characters)? |
@ulfjack I'm not sure if your questions are targeted at me, but I'll do my best.
I don't understand the question. If you are asking about bazel features, I think it's reasonable to accept it wherever you accept
I'm not sure. I would guess it's generally tool specific. Or maybe UTF-8?
Does |
What's the format of an .env file? |
@ulfjack They look like: VAR1=foo
VAR2=bar In general, it's the same format as if it were shell commands so you can source the file. |
Ok, that sounds reasonable. @philwo It will be a bit tricky to support this with our internal remote build system, though. |
I think that would be great to not just to have |
Truly awesome feature if implemented! |
We don't have a team for "all execution" so I am assigning to both Exec teams. |
So as of now, we're still unable to pass in and .env files into bazel test right? |
Any updates on this, or is it still help wanted? |
Hi there! We're doing a clean up of old issues and will be closing this one. Please reopen if you’d like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so. |
Can this be reopened? It would be a very useful feature. |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale. |
not stale |
Excuse me, what progress has been made with this feature? My project uses golang's goravel framework. This framework must use the.env file. I tried to use --action_env and --test_env to add parameters, but it seems that it does not work properly in this framework |
Unfortunately, the Bazel team doesn't have capacity to implement this feature. If anyone from the community wants to contribute, a PR will be very welcomed! |
非常感谢能收到您的回复,我这边已经得到解决了,我采用的方案是使用export将env文件中的内容加载到Linux环境变量中 然后再进行go run 幸运的是我使用的框架支持环境变量替代env文件使用 |
Currently, you can pass environment variables one at a time with
--test_env
. It would be nice to be able to pass an entire file of env variables to bazel test with something like:env are becoming semi-standard, and lots of tools understand how to read them. For example:
docker run --env-file
foreman --env
This improvement would allow people to use their existing env files with bazel.
The text was updated successfully, but these errors were encountered: