I expect cquery when querying tests to reflect flags like --test_env and --test_arg. It appears to reflect these if they're specified on the command line, but not if they're in a .bazelrc file:
Reproduction (making a clean workspace for each run, so we're definitely not seeing weird leftover state from previous runs):
$ dir=$(mktemp -d); (cd "${dir}" && touch WORKSPACE && touch test.sh && chmod 0755 test.sh && echo >BUILD 'sh_test(name = "test", srcs = ["test.sh"])' && bazel cquery //:test 2>/dev/null)
//:test (86e5752)
$ dir=$(mktemp -d); (cd "${dir}" && touch WORKSPACE && touch test.sh && chmod 0755 test.sh && echo >BUILD 'sh_test(name = "test", srcs = ["test.sh"])' && bazel cquery //:test --test_arg=beep 2>/dev/null)
//:test (6a51fd2)
$ dir=$(mktemp -d); (cd "${dir}" && touch WORKSPACE && touch test.sh && chmod 0755 test.sh && echo >BUILD 'sh_test(name = "test", srcs = ["test.sh"])' && echo 'test --test_arg=beep' > .bazelrc && bazel cquery //:test 2>/dev/null)
//:test (86e5752)
cquery does appear to correctly pay attention to .bazelrc files for things that would affect the build actions that produce the tests, but appears to be ignored for things that would affect the test actions.
What operating system are you running Bazel on?
macOS
What's the output of bazel info release?
release 4.0.0
/cc @gregestren
I expect
cquerywhen querying tests to reflect flags like--test_envand--test_arg. It appears to reflect these if they're specified on the command line, but not if they're in a .bazelrc file:Reproduction (making a clean workspace for each run, so we're definitely not seeing weird leftover state from previous runs):
cquerydoes appear to correctly pay attention to.bazelrcfiles for things that would affect the build actions that produce the tests, but appears to be ignored for things that would affect the test actions.What operating system are you running Bazel on?
macOS
What's the output of
bazel info release?release 4.0.0/cc @gregestren