1// Copyright 2024 Google Inc. All rights reserved. 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15package { 16 default_applicable_licenses: ["Android-Apache-2.0"], 17 default_team: "trendy_team_adte", 18} 19 20python_test_host { 21 name: "build_test_suites_test", 22 main: "build_test_suites_test.py", 23 pkg_path: "testdata", 24 srcs: [ 25 "build_test_suites_test.py", 26 ], 27 libs: [ 28 "build_test_suites_lib", 29 "pyfakefs", 30 "ci_test_lib", 31 ], 32 test_options: { 33 unit_test: true, 34 }, 35 data: [ 36 ":py3-cmd", 37 ], 38 version: { 39 py3: { 40 embedded_launcher: true, 41 }, 42 }, 43} 44 45// This test is only intended to be run locally since it's slow, not hermetic, 46// and requires a lot of system state. It is therefore not marked as `unit_test` 47// and is not part of any test suite. Note that we also don't want to run this 48// test with Bazel since that would require disabling sandboxing and explicitly 49// passing in all the env vars we depend on via the command-line. The test 50// target could be configured to do so but it's not worth doing seeing that 51// we're moving away from Bazel. 52python_test_host { 53 name: "build_test_suites_local_test", 54 main: "build_test_suites_local_test.py", 55 srcs: [ 56 "build_test_suites_local_test.py", 57 ], 58 libs: [ 59 "build_test_suites_lib", 60 "pyfakefs", 61 "ci_test_lib", 62 ], 63 test_config_template: "AndroidTest.xml.template", 64 test_options: { 65 unit_test: false, 66 }, 67 version: { 68 py3: { 69 embedded_launcher: true, 70 }, 71 }, 72} 73 74python_test_host { 75 name: "optimized_targets_test", 76 main: "optimized_targets_test.py", 77 pkg_path: "testdata", 78 srcs: [ 79 "optimized_targets_test.py", 80 ], 81 libs: [ 82 "build_test_suites_lib", 83 "pyfakefs", 84 ], 85 test_options: { 86 unit_test: true, 87 }, 88 data: [ 89 ":py3-cmd", 90 ], 91 version: { 92 py3: { 93 embedded_launcher: true, 94 }, 95 }, 96} 97 98python_binary_host { 99 name: "build_test_suites", 100 srcs: [ 101 "build_test_suites.py", 102 "optimized_targets.py", 103 "test_mapping_module_retriever.py", 104 "build_context.py", 105 "test_discovery_agent.py", 106 "metrics_agent.py", 107 "buildbot.py", 108 ], 109 main: "build_test_suites.py", 110 libs: [ 111 "soong-metrics-proto-py", 112 ], 113} 114 115python_library_host { 116 name: "build_test_suites_lib", 117 srcs: [ 118 "build_test_suites.py", 119 "optimized_targets.py", 120 "test_mapping_module_retriever.py", 121 "build_context.py", 122 "test_discovery_agent.py", 123 "metrics_agent.py", 124 "buildbot.py", 125 ], 126 libs: [ 127 "soong-metrics-proto-py", 128 ], 129} 130 131python_library_host { 132 name: "ci_test_lib", 133 srcs: [ 134 "ci_test_lib.py", 135 ], 136} 137