Prefer variants test-only:true attribute when grouping.
When looking at more details of modules that are marked test-only, I saw that `java_test_host` modules were not in the list. The test I wrote for it passes, but in a real run, there are two variants (one windows, one linux) which causes it to fail. The `all_teams` code visis all variants, even not enabled ones. The windows variant, for which GenerateAndroidBuildActions was not being called, did not have a provider and its empty data was overriding the variant for which we had data. I changed the code to prefer variants where it is true. Generally for "test-only", the value is logically true independent of variant, so if one variant sets it true, it should be considered true for all variants. I think this is a slightly better check than preferring a variant with a provider or that is enabled. Prev CL % gqui from "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto team.proto:AllTeams 'select teams.kind, count(*) where teams.test_only = true and teams.kind not like "%cc_%" group by teams.kind' +--------------------------+----------+ | teams.kind | count(*) | +--------------------------+----------+ | android_test | 1382 | | android_test_helper_app | 1680 | | java_fuzz | 5 | | java_test | 774 | | java_test_helper_library | 29 | +--------------------------+----------+ After gqui from "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto ~/aosp-main-with-phones/build/soong/android/team_proto/team.proto:AllTeams ' select teams.kind, count(*) where teams.test_only = true and teams.kind not like "%cc_%" group by teams.kind' +--------------------------+----------+ | teams.kind | count(*) | +--------------------------+----------+ | android_test | 1382 | | android_test_helper_app | 1680 | | csuite_test | 16 | | java_fuzz | 10 | | java_test | 774 | | java_test_helper_library | 35 | | java_test_host | 495 | +--------------------------+----------+ Test: go test ./android Test: m all_teams Test: m blueprint_tests Change-Id: Idc5ed1c0375dc7390a0d58fcb4bf0d7fe1c7ab4f
Loading
Please register or sign in to comment