-test_env和-test_arg对Bazel Cache的效果
我天真地将一些可变测试元数据传递给一些py_test
目标,以将元数据注入一些测试结果伪像,后来后来被上传到云中。我正在使用- test_env
或- test_arg
值bazel test
Invocation的值。
该变量数据是否会对测试结果缓存的方式产生负面影响,以使背对背进行相同的测试会有效地干扰Bazel Cache?
I'm naively passing along some variable test metadata to some py_test
targets to inject that metadata into some test result artifacts that later get uploaded to the cloud. I'm doing so using either the --test_env
or --test_arg
values at the bazel test
invocation.
Would this variable data negatively affect the way test results are cached such that running the same test back to back would effectively disturb the bazel cache?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
命令行输入
命令行输入确实可以打扰缓存命中。考虑以下执行集
构建文件
测试模块
第一次执行
第二执行:相同的参数值,缓存命中!
第三执行:新的参数值,没有缓存命中
第四个执行:与前两个运行相同的参数重复使用
,尽管结果较早地被缓存,但没有缓存命中。不知何故它没有持续。
环境输入
相同的确切行为适用于
- test_env
输入第一个执行
第二执行:相同的env Value,缓存命中!
第三执行:新的env值,无缓存命中
第四个执行:与前两个运行相同的ENV值
Command Line Inputs
Command line inputs can indeed disturb cache hits. Consider the following set of executions
BUILD file
Test module
First execution
Second execution: same argument value, cache hit!
Third execution: new argument value, no cache hit
Fourth execution: reused same argument as first two runs
Interestingly enough there is no cache hit despite the result being cached earlier. Somehow it did not persist.
Environment Inputs
The same exact behavior applies for
--test_env
inputsFirst execution
Second execution: same env value, cache hit!
Third execution: new env value, no cache hit
Fourth execution: reused same env value as first two runs