bazel - writable archivable path for test runtime

左心房为你撑大大i 提交于 2019-11-28 08:53:18

问题


I'm running E2E test using some bazel test target (the scala flavour of java_test).

In Maven I used to dump logs to target/logs folder that was created during test time, and then if something failed - I could have looked in this folder and find the logs.

In bazel - what path can I put in my test logs configuration so it would be writable and conveniently available upon test finish / test failure?


I know that the java.io.tmp dir is writable but gets deleted immediately after test finishes.


回答1:


So digging through bazel docs I found this: https://docs.bazel.build/versions/master/test-encyclopedia.html#initial-conditions

Seems like I can read env variable "TEST_UNDECLARED_OUTPUTS_DIR" and it will give me a writable path. Anything I write there would be zipped and saved under ./bazel-out/darwin-fastbuild/testlogs/<package-name>/<target-name>/test.outputs/outputs.zip

Pretty cool!



来源:https://stackoverflow.com/questions/47871993/bazel-writable-archivable-path-for-test-runtime

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!