[bazel] bazel_test_precompiled.go task driver: Add support for GMs.

This CL makes bazel_test_precompiled.go aware of undeclared outputs produced by GM tests (that is, PNG and JSON files) and re-uses the goldctl steps in goldctl_steps.go to upload those images to Gold.

While a GM executed via "bazel test" will produce an outputs.zip file with undeclared outputs, a test built with Bazel but executed outside of Bazel will place its undeclared outputs in a regular directory. Thus, the MaybeUploadToGold() function in goldctl_steps.go required some changes to support looking for files inside a directory in addition to the logic already in place which extracts from a ZIP file.

This CL also changes function computeTaskSpecificGoldctlKeyValuePairs() in goldctl_steps.go so that the "os" key is set to "android" when the task driver is running on a Raspberry Pi, which is assumed to be attached to an Android device. This is a temporary hack to have a quick way to check that we are able to generate different traces with different keys for the same image. I'll delete this hack as soon as we have a more permanent solution (see comments).

Recommended review order:

- //infra/bots/task_drivers/bazel_test_precompiled/bazel_test_precompiled.go
- //infra/bots/task_drivers/bazel_test_precompiled/bazel_test_precompiled_test.go
- //gm/BUILD.bazel
- //infra/bots/jobs.json
- //infra/bots/gen_tasks_logic/gen_tasks_logic.go
- //infra/bots/task_drivers/common/goldctl_steps.go
- //infra/bots/task_drivers/common/goldctl_steps_test.go
- Everything else.

Bug: b/40045301
Change-Id: Ib970e2467848aa0ef0b1c67d7c5eb211dd40f2a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/750658
Auto-Submit: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
16 files changed