Skip to content

feature request: testonly run targets with captured outputs #465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
novas0x2a opened this issue May 16, 2025 · 0 comments
Open

feature request: testonly run targets with captured outputs #465

novas0x2a opened this issue May 16, 2025 · 0 comments

Comments

@novas0x2a
Copy link

novas0x2a commented May 16, 2025

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",
    ],
    ...
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant