xref: /aosp_15_r20/development/tools/compare_cts_reports/README.md (revision 90c8c64db3049935a07c6143d7fd006e26f8ecca)
1*90c8c64dSAndroid Build Coastguard WorkerThis tool is used to analyze cts reports. Three scripts are included and can be used separately.
2*90c8c64dSAndroid Build Coastguard Worker
3*90c8c64dSAndroid Build Coastguard Worker# Terminology
4*90c8c64dSAndroid Build Coastguard Worker### Report
5*90c8c64dSAndroid Build Coastguard WorkerA report can be either a standard CTS result zip file, or a test_result.xml file.
6*90c8c64dSAndroid Build Coastguard Worker### Information files
7*90c8c64dSAndroid Build Coastguard Worker"Information files" indicates three files: `info.json`, `result.csv`, `summary.csv`
8*90c8c64dSAndroid Build Coastguard Worker
9*90c8c64dSAndroid Build Coastguard Worker# Scripts
10*90c8c64dSAndroid Build Coastguard Worker## parse_cts_report.py
11*90c8c64dSAndroid Build Coastguard Worker### usage
12*90c8c64dSAndroid Build Coastguard Worker```
13*90c8c64dSAndroid Build Coastguard Worker./parse_cts_report.py -r REPORT -d OUTPUT_DIR [--abi [{armeabi-v7a,arm64-v8a,x86,x86_64} ...]]
14*90c8c64dSAndroid Build Coastguard Worker```
15*90c8c64dSAndroid Build Coastguard Worker
16*90c8c64dSAndroid Build Coastguard WorkerThe `-r` flag must be followed by exactly one report.
17*90c8c64dSAndroid Build Coastguard Worker
18*90c8c64dSAndroid Build Coastguard WorkerThe `-d` flag specifies the directory in which the information files will be stored.
19*90c8c64dSAndroid Build Coastguard Worker
20*90c8c64dSAndroid Build Coastguard WorkerThe `--abi` flag can be used to select one or more test ABIs to be parsed.
21*90c8c64dSAndroid Build Coastguard Worker
22*90c8c64dSAndroid Build Coastguard Worker## aggregate_cts_reports.py
23*90c8c64dSAndroid Build Coastguard Worker### usage
24*90c8c64dSAndroid Build Coastguard Worker```
25*90c8c64dSAndroid Build Coastguard Worker./aggregate_cts_reports.py -r REPORT [REPORT ...] -d OUTPUT_DIR [--ignore-abi] [--abi [{armeabi-v7a,arm64-v8a,x86,x86_64} ...]]
26*90c8c64dSAndroid Build Coastguard Worker```
27*90c8c64dSAndroid Build Coastguard Worker
28*90c8c64dSAndroid Build Coastguard WorkerThe `-r` flag can be followed by one or more reports.
29*90c8c64dSAndroid Build Coastguard Worker
30*90c8c64dSAndroid Build Coastguard WorkerThe `-d` flag has the same behavior as `parse_cts_report.py`.
31*90c8c64dSAndroid Build Coastguard Worker
32*90c8c64dSAndroid Build Coastguard Worker`--ignore-abi` is a boolean flag. If users specify this flag, tests ABI would be ignored while doing the aggregation. It means that two tests would be considered as the same one as long as they have the same module_name#class_name.test_name.
33*90c8c64dSAndroid Build Coastguard Worker
34*90c8c64dSAndroid Build Coastguard WorkerThe `--abi` flag can be used to select one or more test ABIs to be aggregated.
35*90c8c64dSAndroid Build Coastguard Worker
36*90c8c64dSAndroid Build Coastguard Worker## compare_cts_reports.py
37*90c8c64dSAndroid Build Coastguard Worker### usage
38*90c8c64dSAndroid Build Coastguard Worker```
39*90c8c64dSAndroid Build Coastguard Worker./compare_cts_reports.py [-h] [-r CTS_REPORTS [CTS_REPORTS ...]] [-f CTS_REPORTS] --mode {1,2,n} --output-dir OUTPUT_DIR [--csv CSV] [--output-files] [--ignore-abi]
40*90c8c64dSAndroid Build Coastguard Worker```
41*90c8c64dSAndroid Build Coastguard Worker
42*90c8c64dSAndroid Build Coastguard WorkerOne `-r` flag is followed by a group of report files that you want to aggregate.
43*90c8c64dSAndroid Build Coastguard Worker
44*90c8c64dSAndroid Build Coastguard WorkerOne `-f` flag is followed by **one** path to a folder, which contains parsed information files.
45*90c8c64dSAndroid Build Coastguard Worker
46*90c8c64dSAndroid Build Coastguard WorkerThe `-m` flag has to be specified: `1` for one-way mode, `2` for two-way mode, and `n` for n-way mode.
47*90c8c64dSAndroid Build Coastguard Worker
48*90c8c64dSAndroid Build Coastguard WorkerThe `-d` flag has to be specified. Behavior same as `parse_cts_report.py`.
49*90c8c64dSAndroid Build Coastguard Worker
50*90c8c64dSAndroid Build Coastguard Worker`--csv` allows users to specify the file name of the comparison result. The default value is `diff.csv`.
51*90c8c64dSAndroid Build Coastguard Worker
52*90c8c64dSAndroid Build Coastguard Worker`--output-files/-o` is a boolean flag. If users specify this flag, the parsed results of reports after flags `-r` will be outputed into the information files.
53*90c8c64dSAndroid Build Coastguard Worker
54*90c8c64dSAndroid Build Coastguard Worker`--ignore-abi` is a boolean flag, which has the same behavior as `aggregate_cts_reports.py`.
55*90c8c64dSAndroid Build Coastguard Worker
56*90c8c64dSAndroid Build Coastguard Worker### modes
57*90c8c64dSAndroid Build Coastguard Worker#### One-way Comparison
58*90c8c64dSAndroid Build Coastguard WorkerThe two reports from user input are report A and report B, respectively. Be careful that the order matters.
59*90c8c64dSAndroid Build Coastguard Worker
60*90c8c64dSAndroid Build Coastguard WorkerOne-way comparison lists the tests that fail in report A and the corresponding results in both reports.
61*90c8c64dSAndroid Build Coastguard Worker
62*90c8c64dSAndroid Build Coastguard Worker#### Two-way Comparison
63*90c8c64dSAndroid Build Coastguard WorkerTwo-way comparison lists the tests where report A and report B have different results. If a test only exists in one of the reports, the test result of the other report will be indicated as `null`.
64*90c8c64dSAndroid Build Coastguard Worker
65*90c8c64dSAndroid Build Coastguard Worker#### N-way Comparison
66*90c8c64dSAndroid Build Coastguard WorkerN-way comparison mode is used to show a summary of several test reports.
67*90c8c64dSAndroid Build Coastguard Worker- The summaries are based on each module_name-abi pair. We call this pair "module" to simplify the explanation.
68*90c8c64dSAndroid Build Coastguard Worker- Modules are sorted by the lowest pass rate among all reports. That is, if a module has a pass rate of 0.0 in one of the reports, it will be listed on the very top of `diff.csv`.
69*90c8c64dSAndroid Build Coastguard Worker
70*90c8c64dSAndroid Build Coastguard Worker## Tests
71*90c8c64dSAndroid Build Coastguard Worker```
72*90c8c64dSAndroid Build Coastguard Worker./test_parse_cts_report.py
73*90c8c64dSAndroid Build Coastguard Worker./test_aggregate_cts_reports.py
74*90c8c64dSAndroid Build Coastguard Worker./test_compare_cts_reports.py
75*90c8c64dSAndroid Build Coastguard Worker```
76