[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
tree: e957acf248af52331eecd0b539623bd4dc6e61bd
  1. cipd/
  2. config/
  3. infra/
  4. manifests/
  5. scripts/
  6. shac/
  7. tests/
  8. third_party/
  9. .bazelrc
  10. .gitignore
  11. .gitmodules
  12. AUTHORS
  13. BUILD.bazel
  14. CONTRIBUTING.md
  15. LICENSE
  16. OWNERS
  17. PATENTS
  18. README.md
  19. WORKSPACE.bazel
  20. workspace.bzl
README.md

Fuchsia Infra Bazel Rules

This repository provides tools and Bazel rules for helping projects integrate with Fuchsia's CI infrastructure.