bazel-contrib / bazel-contrib/rules_bazel_integration_test

feature request: testonly run targets with captured outputs

Open
#465 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
65
Forks
16
Avg merge
1d 9h
Merged PRs (30d)
9

Description

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:

```bazel
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",
],
...
)
```

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by locating the default_test_runner and bazel_integration_run entry points, then inspect how they interact with sh_test and child workspaces. Done should include a focused testonly example proving that child-workspace command output is available to the main test.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.