David Dorwin | fe186dd | 2022-05-20 18:35:13 | [diff] [blame] | 1 | # Running GPU integration tests on Fuchsia |
| 2 | |
| 3 | [TOC] |
Chong Gu | 4749ec1 | 2021-02-17 01:41:06 | [diff] [blame] | 4 | |
| 5 | General instruction on running and debugging GPU integration tests can be |
| 6 | found [here](../gpu/gpu_testing.md). |
| 7 | |
David Dorwin | e280da2 | 2022-06-28 14:53:27 | [diff] [blame] | 8 | Fuchsia uses either [web_engine_shell](../../fuchsia_web/shell/README.md) |
Chong Gu | e20fa1b | 2022-02-28 23:12:08 | [diff] [blame] | 9 | or the Chrome browser to run GPU integration tests. For the sake of this |
| 10 | example, we will be using `web_engine_shell` as the target browser and |
| 11 | `gpu_process` as the test suite we wish to execute. Build the target |
| 12 | `telemetry_gpu_integration_test_fuchsia` and run the appropriate commands: |
Chong Gu | 4749ec1 | 2021-02-17 01:41:06 | [diff] [blame] | 13 | |
| 14 | ## Hermetic emulation |
| 15 | |
| 16 | The test script brings up an emulator, runs the tests on it, and shuts the |
| 17 | emulator down when finished. |
| 18 | |
| 19 | ```bash |
| 20 | $ content/test/gpu/run_gpu_integration_test_fuchsia.py gpu_process |
| 21 | --browser=web-engine-shell --out-dir=/path/to/outdir |
| 22 | ``` |
| 23 | |
Rohan Pavone | b0338c8f | 2022-11-14 20:49:02 | [diff] [blame] | 24 | ## Additional flags |
| 25 | |
| 26 | You can specify the following flags to help replicate failure cases: |
| 27 | |
| 28 | - `--test-filter=<regex of test cases>`: Use this to filter test cases |
| 29 | - `--total-shards=<num shards>`: Specify total number of shards to split tests |
| 30 | over. You would use this to replicate sharding on a bot. |
| 31 | - `--shard-index=<shard index>`: Specify shard index for splitting up the given |
| 32 | tests. |
| 33 | |
Chong Gu | 4749ec1 | 2021-02-17 01:41:06 | [diff] [blame] | 34 | ## Run on an physical device |
| 35 | |
Chong Gu | c6ce4f71 | 2022-11-01 22:20:15 | [diff] [blame] | 36 | If ffx has already been set up to use the target device by default, |
| 37 | or if there is only one discoverable device on the host: |
| 38 | |
Chong Gu | 4749ec1 | 2021-02-17 01:41:06 | [diff] [blame] | 39 | ```bash |
| 40 | $ content/test/gpu/run_gpu_integration_test_fuchsia.py gpu_process |
| 41 | --browser=web-engine-shell --out-dir=/path/to/outdir -d |
| 42 | ``` |
| 43 | |
Chong Gu | c6ce4f71 | 2022-11-01 22:20:15 | [diff] [blame] | 44 | Otherwise, specify the id of the target device: |
| 45 | |
| 46 | ```bash |
| 47 | $ content/test/gpu/run_gpu_integration_test_fuchsia.py gpu_process |
| 48 | --browser=web-engine-shell --out-dir=/path/to/outdir --target-id=[TARGET_ID] |
Zijie He | 59457f9 | 2024-08-26 21:59:18 | [diff] [blame] | 49 | ``` |
Rohan Pavone | b0338c8f | 2022-11-14 20:49:02 | [diff] [blame] | 50 | |
| 51 | ### Updating OS flag |
| 52 | You can update the OS of a device by specifying the path to an image and how |
| 53 | to check the OS: |
| 54 | |
| 55 | ```bash |
| 56 | $ content/test/gpu/run_gpu_integration_test_fuchsia.py gpu_process |
| 57 | --browser=web-engine-shell --out-dir=/path/to/outdir -d --os-check=check |
| 58 | --system-image-dir=path/to/dir/containing/image |
Chong Gu | c6ce4f71 | 2022-11-01 22:20:15 | [diff] [blame] | 59 | ``` |
| 60 | |
Chong Gu | de2b3210e | 2022-09-29 19:47:56 | [diff] [blame] | 61 | ## Run on a device that needs packages built from Fuchsia source |
Chong Gu | 4749ec1 | 2021-02-17 01:41:06 | [diff] [blame] | 62 | |
| 63 | ```bash |
| 64 | $ content/test/gpu/run_gpu_integration_test_fuchsia.py gpu_process |
| 65 | --browser=web-engine-shell --out-dir=/path/to/outdir -d |
Chong Gu | de2b3210e | 2022-09-29 19:47:56 | [diff] [blame] | 66 | --repo=/path/to/fuchsia/outdir --no-repo-init |
Chong Gu | 4749ec1 | 2021-02-17 01:41:06 | [diff] [blame] | 67 | ``` |
| 68 | |
Chong Gu | de2b3210e | 2022-09-29 19:47:56 | [diff] [blame] | 69 | Note that `fx serve` should not be running, since the script |
| 70 | handles launching the package server from the Fuchsia output directory. |
Shahbaz Youssefi | 45c205e | 2021-03-24 03:32:00 | [diff] [blame] | 71 | |
Chong Gu | 4749ec1 | 2021-02-17 01:41:06 | [diff] [blame] | 72 | ## Run on a device the host is connected to remotely via ssh |
| 73 | |
Chong Gu | 4749ec1 | 2021-02-17 01:41:06 | [diff] [blame] | 74 | ```bash |
| 75 | $ content/test/gpu/run_gpu_integration_test_fuchsia.py gpu_process |
Chong Gu | c6ce4f71 | 2022-11-01 22:20:15 | [diff] [blame] | 76 | --browser=web-engine-shell --out-dir=/path/to/outdir --target-id=[::1]:8022 |
Shahbaz Youssefi | 45c205e | 2021-03-24 03:32:00 | [diff] [blame] | 77 | ``` |
Chong Gu | de2b3210e | 2022-09-29 19:47:56 | [diff] [blame] | 78 | |
| 79 | Note the this requires a remote tunnel to have been set up first. |