xref: /aosp_15_r20/libcore/tools/testmapping/README (revision 89a6322812dc8573315e60046e7959c50dad91d4)
1*89a63228SAndroid Build Coastguard WorkerThese scripts help generate the libcore TEST_MAPPING smoke tests, i.e. a set of
2*89a63228SAndroid Build Coastguard Workertests to run on every change, chosen to run as many as possible in less than
3*89a63228SAndroid Build Coastguard Workersome time limit.
4*89a63228SAndroid Build Coastguard Worker
5*89a63228SAndroid Build Coastguard WorkerThe process is as follows.
6*89a63228SAndroid Build Coastguard Worker1. Do `source build/envsetup.sh` and `lunch <whatever>` as normal.
7*89a63228SAndroid Build Coastguard Worker2. Run the CtsLibcoreTestCases tests to generate logs to extract timings from.
8*89a63228SAndroid Build Coastguard Worker   This can be done with `atest CtsLibcoreTestCases` as normal. Make sure to use
9*89a63228SAndroid Build Coastguard Worker   an appropriate device (virtual or physical).
10*89a63228SAndroid Build Coastguard Worker3. Do that two more times. We'll use best-of-three timings, since sometimes a
11*89a63228SAndroid Build Coastguard Worker   test takes an unusual amount of time (perhaps because of GC pause or other
12*89a63228SAndroid Build Coastguard Worker   jank) and it should not be excluded for that.
13*89a63228SAndroid Build Coastguard Worker4. Run the save_logs.py script to copy the logs from out/ to libcore/smoketest.
14*89a63228SAndroid Build Coastguard Worker   (Empty that directory if it exists already). This is interactive and allows
15*89a63228SAndroid Build Coastguard Worker   you to pick the runs you want. (If you prefer, you can run this after each
16*89a63228SAndroid Build Coastguard Worker   run, rather than once after all three runs.)
17*89a63228SAndroid Build Coastguard Worker5. Run the gen_smoke_tests.py script to generate libcore/TEST_MAPPING.
18*89a63228SAndroid Build Coastguard Worker6. Check stdout from the script looks okay (not too many warnings, sensible
19*89a63228SAndroid Build Coastguard Worker   numbers, etc.).
20*89a63228SAndroid Build Coastguard Worker7. Check the generated TEST_MAPPING looks okay.
21*89a63228SAndroid Build Coastguard Worker8. Do e.g. `time atest --test-mapping libcore` to check it runs okay.
22*89a63228SAndroid Build Coastguard Worker9. Delete libcore/smoketest/ once you're happy.
23*89a63228SAndroid Build Coastguard Worker10. Submit the new TEST_MAPPING.
24*89a63228SAndroid Build Coastguard Worker
25*89a63228SAndroid Build Coastguard WorkerThe scripts take no options. There are some constants at the start you can
26*89a63228SAndroid Build Coastguard Workeradjust. (These could be converted to command-line options if convenient.)
27*89a63228SAndroid Build Coastguard Worker
28*89a63228SAndroid Build Coastguard WorkerSee comments in the scripts for more on how they work.
29*89a63228SAndroid Build Coastguard Worker
30*89a63228SAndroid Build Coastguard WorkerAt time of writing, with the current configuration, this generates a sensible
31*89a63228SAndroid Build Coastguard Workernumber of classes to exclude, so the TEST_MAPPING looks reasonable. If this list
32*89a63228SAndroid Build Coastguard Workerbecomes too long, we'll have to find a way to simplify it, by rolling up to a
33*89a63228SAndroid Build Coastguard Workerhigher granularity. Given the way that atest et al are configured, that will
34*89a63228SAndroid Build Coastguard Workerprobably mean excluding more things.
35*89a63228SAndroid Build Coastguard Worker
36*89a63228SAndroid Build Coastguard WorkerTODO(peteg): What about PTS?
37