blob: 74b7853c4560acded9620b0eab3252e2c85c0294 [file] [log] [blame]
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/dart/dart_library.gni")
import("//build/dart/test.gni")
import("//build/testing/environments.gni")
import("//build/testing/host_test_data.gni")
# This directory contains Dart wrappers for running performance tests
# that are defined elsewhere in the Fuchsia tree.
#
# The test wrappers in this directory are split into multiple test
# executables (dart_test targets here) because the Fuchsia Infra tools
# for retrying tests and tracking flakes operate on the granularity of
# test executables.
test_list = [
"dart_inspect_benchmarks_test",
"garnet_input_latency_benchmarks_test",
"kernel_boot_timeline_test",
"microbenchmarks_test",
"netstack_benchmarks_test",
"netstack_iperf_test",
"rust_inspect_benchmarks_test",
"tspec_example_test",
]
foreach(target_name, test_list) {
dart_test(target_name) {
sources = [ "$target_name.dart" ]
deps = [
"//sdk/testing/sl4f/client",
"//third_party/dart-pkg/pub/test",
]
non_dart_deps = [ ":runtime_deps($host_toolchain)" ]
environments = [
# Runs on "main" builders (try and ci) in NUC environments.
nuc_env,
]
}
}
# Split fidl_microbenchmarks_test into shards so that each shard fits
# within the default time limit.
shards = [
"0",
"1",
"2",
]
total_shards = "3"
foreach(shard, shards) {
target_name = "fidl_microbenchmarks_test_shard_" + shard
dart_test(target_name) {
sources = [ "fidl_microbenchmarks_test.dart" ]
args = [
"--total-shards=" + total_shards,
"--shard-index=" + shard,
]
deps = [
"//sdk/testing/sl4f/client",
"//third_party/dart-pkg/pub/test",
]
non_dart_deps = [ ":runtime_deps($host_toolchain)" ]
environments = [ nuc_env ]
}
test_list += [ target_name ]
}
if (is_host) {
host_test_data("runtime_deps") {
sources = [
"$root_out_dir/catapult_converter",
"$root_out_dir/trace2json",
]
outputs = [ "$target_gen_dir/runtime_deps/{{source_file_part}}" ]
deps = [
"//garnet/bin/catapult_converter:converter_bin",
"//garnet/bin/trace2json:bin",
]
# TODO(48350): Enable host build for non-linux hosts as well.
if (host_os == "linux") {
sources += [ "$root_out_dir/iperf3" ]
deps += [ "//third_party/iperf:bin" ]
}
}
}
# Packages required either:
# 1) by the Dart test wrappers in this directory, or
# 2) by the older test runner in src/tests/benchmarks/ which is
# used by the peridot-perf and fuchsia-perfcompare builders. This
# test runner will eventually be replaced by the Dart test
# wrappers (TODO(fxb/23091)), but sharing the same dependency
# declarations will ease this transition.
group("package_deps") {
testonly = true
public_deps = [
"//garnet/examples/benchmark",
"//src/connectivity/network/tests/benchmarks:netstack_benchmarks",
"//src/lib/inspect/rust/fuchsia-inspect:benchmarks",
"//src/tests/benchmarks:kernel-boot-benchmarks",
"//src/tests/benchmarks/fidl:benchmarks",
"//src/tests/microbenchmarks:fuchsia_microbenchmarks_perftestmode",
"//third_party/iperf",
"//topaz/tests/dart-inspect-benchmarks",
# These are used by garnet_input_latency_benchmarks.
"//src/ui/bin/activity",
"//src/ui/examples:simplest_app",
"//src/ui/examples:yuv_to_image_pipe",
"//src/ui/tools:present_view",
# These are used by the test runner in src/tests/benchmarks/,
# used by the peridot-perf and fuchsia-perfcompare builders.
"//garnet/bin/catapult_converter",
"//garnet/bin/trace2json:bin",
"//src/tests/benchmarks:fuchsia_benchmarks",
"//third_party/sbase:mkdir",
"//third_party/sbase:rm",
"//third_party/sbase:touch",
]
}
group("test") {
testonly = true
deps = []
foreach(target_name, test_list) {
deps += [ ":$target_name($host_toolchain)" ]
}
}
group("touch_input_test") {
testonly = true
deps = [
":touch_input_latency_benchmarks_test($host_toolchain)",
"//garnet/bin/sl4f",
"//src/ui/tests/e2e_input_tests/touch:tests",
]
}
# Runs the benchmark for touch latency
dart_test("touch_input_latency_benchmarks_test") {
sources = [ "touch_input_latency_benchmarks_test.dart" ]
deps = [
"//sdk/testing/sl4f/client",
"//third_party/dart-pkg/pub/test",
]
non_dart_deps = [ ":runtime_deps($host_toolchain)" ]
environments = [
# Runs on "main" builders (try and ci) in NUC environments.
nuc_env,
]
}
# Unit test of processing logic for touch latency
group("tests") {
testonly = true
deps = [ ":touch_input_latency_metric_test($host_toolchain)" ]
}
dart_test("touch_input_latency_metric_test") {
sources = [ "touch_input_latency_metric_test.dart" ]
deps = [
"//sdk/testing/sl4f/client",
"//third_party/dart-pkg/pub/test",
]
}