[testing] Fix emu and host local testing workflows
Fixes local testing workflow for emulator and host test groups. Aside
from code refactor, performs the following:
1. Handles relative symlink targets when creating a sandbox. Previously,
we assumed that all symlink targets were absolute.
2. Handles symlink targets that may exist in the execroot, but are not
specified in the runfiles. In this case, we should materialize the
symlink.
3. Prepend `luci-auth context -expose-system-account --` to emulate test
group execution in a swarming context.
a. While the LUCI_CONTEXT environment variable is defined,
result_sink isn't defined in the json file pointed to by
LUCI_CONTEXT. So check for existence of that property in addition
to the existence of LUCI_CONTEXT when determining whether
run_test_group.py should upload test results to ResultDB.
Bug: 315215203
Change-Id: I256b83cb9edb9220fa2566c60fd7ed26e6e69e47
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia-infra-bazel-rules/+/987476
Reviewed-by: Vinicius Felizardo <felizardo@google.com>
Reviewed-by: Chase Latta <chaselatta@google.com>
Commit-Queue: Darren Chan <chandarren@google.com>
3 files changed