I was trying to write a weird test, and in my case it would be a lot easier if I could run some commands in the child workspace, but then have the output of that come back to the main workspace and have the main test actually run there. This avoids the need to do a bunch of heavy setup in the child workspace. Something like:
default_test_runner(
name = "cquery",
# do something that violates transitive closure, so can't be a genquery
bazel_cmds = ["cquery --output files ..."] ,
)
bazel_integration_run(
name = "child_data_stdout",
test_runner = ":cquery",
testonly = True,
...
)
sh_test(
name = "test",
data = [
":child_data_stdout",
":lots_of",
":local_targets",
],
...
)
I was trying to write a weird test, and in my case it would be a lot easier if I could run some commands in the child workspace, but then have the output of that come back to the main workspace and have the main test actually run there. This avoids the need to do a bunch of heavy setup in the child workspace. Something like: