blob: 28b9d85f1e026379977e728398ebe90314b3fb0f [file] [log] [blame] [view]
David Dorwinfe186dd2022-05-20 18:35:131# Running GPU integration tests on Fuchsia
2
3[TOC]
Chong Gu4749ec12021-02-17 01:41:064
5General instruction on running and debugging GPU integration tests can be
6found [here](../gpu/gpu_testing.md).
7
David Dorwine280da22022-06-28 14:53:278Fuchsia uses either [web_engine_shell](../../fuchsia_web/shell/README.md)
Chong Gue20fa1b2022-02-28 23:12:089or the Chrome browser to run GPU integration tests. For the sake of this
10example, 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 Gu4749ec12021-02-17 01:41:0613
14## Hermetic emulation
15
16The test script brings up an emulator, runs the tests on it, and shuts the
17emulator 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 Pavoneb0338c8f2022-11-14 20:49:0224## Additional flags
25
26You 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 Gu4749ec12021-02-17 01:41:0634## Run on an physical device
35
Chong Guc6ce4f712022-11-01 22:20:1536If ffx has already been set up to use the target device by default,
37or if there is only one discoverable device on the host:
38
Chong Gu4749ec12021-02-17 01:41:0639```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 Guc6ce4f712022-11-01 22:20:1544Otherwise, 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 He59457f92024-08-26 21:59:1849```
Rohan Pavoneb0338c8f2022-11-14 20:49:0250
51### Updating OS flag
52You can update the OS of a device by specifying the path to an image and how
53to 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 Guc6ce4f712022-11-01 22:20:1559```
60
Chong Gude2b3210e2022-09-29 19:47:5661## Run on a device that needs packages built from Fuchsia source
Chong Gu4749ec12021-02-17 01:41:0662
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 Gude2b3210e2022-09-29 19:47:5666--repo=/path/to/fuchsia/outdir --no-repo-init
Chong Gu4749ec12021-02-17 01:41:0667```
68
Chong Gude2b3210e2022-09-29 19:47:5669Note that `fx serve` should not be running, since the script
70handles launching the package server from the Fuchsia output directory.
Shahbaz Youssefi45c205e2021-03-24 03:32:0071
Chong Gu4749ec12021-02-17 01:41:0672## Run on a device the host is connected to remotely via ssh
73
Chong Gu4749ec12021-02-17 01:41:0674```bash
75$ content/test/gpu/run_gpu_integration_test_fuchsia.py gpu_process
Chong Guc6ce4f712022-11-01 22:20:1576--browser=web-engine-shell --out-dir=/path/to/outdir --target-id=[::1]:8022
Shahbaz Youssefi45c205e2021-03-24 03:32:0077```
Chong Gude2b3210e2022-09-29 19:47:5678
79Note the this requires a remote tunnel to have been set up first.