豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 4dc6a89

Browse files
committed
fix(bazel): integration test rule not collecting transitive runfiles of data
Fixes that the integration test rule does not collect transitive runfiles of `data` dependencies. This is a prerequisite for relying on actual other Bazel-managed tools within an integration test.
1 parent 21956b6 commit 4dc6a89

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

bazel/integration/index.bzl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,18 @@ def _integration_test_config_impl(ctx):
8686
content = json.encode(config),
8787
)
8888

89-
runfiles = [config_file] + ctx.files.data + ctx.files.srcs + npmPackageFiles + toolFiles
89+
runfiles = ctx.runfiles(
90+
[config_file] + ctx.files.data + ctx.files.srcs + npmPackageFiles + toolFiles,
91+
)
92+
93+
# Include transitive runfiles for `data` dependencies.
94+
for data_dep in ctx.attr.data:
95+
runfiles = runfiles.merge(data_dep[DefaultInfo].default_runfiles)
9096

9197
return [
9298
DefaultInfo(
9399
files = depset([config_file]),
94-
runfiles = ctx.runfiles(files = runfiles),
100+
runfiles = runfiles,
95101
),
96102
]
97103

0 commit comments

Comments
 (0)