Upload undeclared outputs of failed/flaky/timed out tests (#2169)
Test failures can require information present in undeclared outputs to
diagnose, which if not uploaded means needing to first reproduce the
failure locally.
e.g.
https://buildkite.com/bazel/bazel-bazel-github-presubmit/builds/25623#0194aa2c-7bd9-466b-bd15-d7eec8ef58dc
(failure in `test.log` references a file in `test.outputs`) from
https://github.com/bazelbuild/bazel/pull/25050
This PR adds uploading of `test.outputs/*` files for tests that
fail/flake/timeout.
It also;
* Simplifies `local_exec_root.as_ref().map(|p| p.as_path()),` to
`local_exec_root.as_deref(),` (clippy suggestion)
* Lifts the upload decision (dubbed `include_output` in this PR) up a
level so it can be used in the new code branch. I'm fairly `test.log` is
a mandatory test output, so this change should not affect performance.
3 files changed