[roll] Roll fuchsia [build][api] Add affected_tests client command.

Add a new //build/api/client command which can determine the list
of test targets (from $BUILD_DIR/tests.json) that are affected by
set of changed source files.

Note that for correctness, this must be run after a build completes
in order to use implicit dependencies recorded in the Ninja deps log
(which is critical for Bazel targets and their source dependencies).

In addition to the unit-tests contained in this CL, manual checking
can be performed with the following instructions:

```bash
$ fx set core.vim3 --with //src:tests_no_e2e
$ fx build
$ build/api/client affected_tests --files-list=<(echo sdk/lib/driver/devicetree/examples/example-board/integration-test.cc)
//src:adc-buttons-test.extract(//build/toolchain/fuchsia:arm64)
//src:aml-g12-composite-test.extract(//build/toolchain/fuchsia:arm64)
//src:aml-gpio-test.extract(//build/toolchain/fuchsia:arm64)
//src:aml-i2c-test.extract(//build/toolchain/fuchsia:arm64)
//src:aml-usb-phy-test.extract(//build/toolchain/fuchsia:arm64)
//src:driver_transport_example_test.extract(//build/toolchain/fuchsia:arm64)
//src:dwc3-test.extract(//build/toolchain/fuchsia:arm64)
//src:example-board-test.extract(//build/toolchain/fuchsia:arm64)
//src:my_driver_cpp_test.extract(//build/toolchain/fuchsia:arm64)
//src:pipeline_test.extract(//build/toolchain/fuchsia:arm64)
//src:simple-driver-test.extract(//build/toolchain/fuchsia:arm64)
//src:spmi-hwreg-test.extract(//build/toolchain/fuchsia:arm64)
//src:template-test.extract(//build/toolchain/fuchsia:arm64)
//src:vim3-clk-test.extract(//build/toolchain/fuchsia:arm64)
//src:vim3-devicetree-test.extract(//build/toolchain/fuchsia:arm64)
```

The result above shows more test targets than absolutely necessary
because all the reported test targets are generated from the same
GN //src:bazel_tests target defined using the bazel_test_package_group().

Finer results (i.e. only listing //src:vim3-devicetree-test.extract
here) will be possible in the future once Bazel test targets are
exposed individually to `fx test` and `botanist` (see
https://fxbug.dev/349341932).

Original-Bug: 427455042
Original-Bug: 349341932
Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1414397
Original-Revision: 2fb71e261b8aa4b9d6735f7101443d5c5b62140c
GitOrigin-RevId: 4f7b4bfe26cc21b9d22a671fca8c2bb6e6aac550
Change-Id: I23fb65a499cbde82ba8ae4c8fbda89f7cd107099
1 file changed
tree: e949ad9e7624fa55419186285d349d6555d88d8a
  1. ctf/
  2. git-hooks/
  3. infra/
  4. third_party/
  5. flower
  6. jiri.lock
  7. MILESTONE
  8. minimal
  9. prebuilts
  10. README.md
  11. stem
  12. test_durations
README.md

Integration

This repository contains Fuchsia's Global Integration manifest files.

Making changes

All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.

Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance in one of the communication channels documented at get involved.

Obtaining the source

First install Jiri.

Next run:

$ jiri init
$ jiri import minimal https://fuchsia.googlesource.com/integration
$ jiri update

Third party

Third party projects should have their own subdirectory in ./third_party.