blob: cde173f0e84ccd138b588df4188b9d1b65433afd [file] [log] [blame]
# Copyright 2017 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/components.gni")
import("//build/fuzzing/fuzzer.gni")
import("//src/sys/core/build/core_shard.gni")
group("tests") {
testonly = true
deps = [
":cobalt-manual-tests",
":cobalt_tests",
"app",
"system-metrics",
"testapp",
"testing",
"utils",
]
}
fuchsia_test_component("cobalt_app_unittests") {
manifest = "meta/cobalt_app_unittests.cml"
deps = [ "app:cobalt_app_unittests" ]
}
fuchsia_test_component("cobalt_system_metrics_unittests") {
manifest = "meta/cobalt_system_metrics_unittests.cml"
deps = [ "system-metrics:cobalt_system_metrics_unittests" ]
}
fuchsia_unittest_component("cobalt_utils_unittests") {
deps = [ "utils:cobalt_utils_unittests" ]
}
fuchsia_test_component("cobalt_testapp_no_network") {
manifest = "meta/cobalt_testapp_no_network.cml"
deps = [ "testapp:cobalt_testapp" ]
}
template("testapp_cobalt_components") {
test_name = target_name
if (defined(invoker.name)) {
test_name = invoker.name
} else {
not_needed(invoker, "*")
}
fuchsia_test_component("variant_${test_name}_with_event_aggregator") {
component_name = "cobalt_with_event_aggregator_worker"
manifest =
"meta/cobalt_variants/${test_name}_with_event_aggregator_worker.cml"
deps = [ "app" ]
}
fuchsia_test_component("variant_${test_name}_no_event_aggregator") {
component_name = "cobalt_no_event_aggregator_worker"
manifest =
"meta/cobalt_variants/${test_name}_no_event_aggregator_worker.cml"
deps = [ "app" ]
}
group(target_name) {
testonly = true
deps = [
":variant_${test_name}_no_event_aggregator",
":variant_${test_name}_with_event_aggregator",
]
}
}
testapp_cobalt_components("variants_networked_components") {
name = "networked"
}
testapp_cobalt_components("variants_no_network_components") {
name = "no_network"
}
resource("testapp_metrics_registry") {
sources = [ rebase_path(
get_label_info("app:testapp_metrics_registry", "target_gen_dir") +
"/testapp_metrics_registry.pb") ]
outputs = [ "data/testapp_metrics_registry.pb" ]
}
fuchsia_test_package("cobalt_tests") {
test_components = [
":cobalt_app_unittests",
":cobalt_system_metrics_unittests",
":cobalt_utils_unittests",
":cobalt_testapp_no_network",
]
deps = [
":testapp_metrics_registry",
":variants_no_network_components",
"app:analyzer_devel_public",
"app:cobalt_devel_environment",
"app:global_metrics_registry",
"app:shuffler_devel_public",
"app:testapp_metrics_registry",
]
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
}
fuchsia_test_component("cobalt-testapp") {
manifest = "meta/cobalt_testapp.cml"
deps = [ "testapp:cobalt_testapp" ]
}
# Tests that should not be run on any bot.
# These should be run locally to verify that the cobalt_testapp works with
# networking.
fuchsia_test_package("cobalt-manual-tests") {
test_components = [ ":cobalt-testapp" ]
deps = [
":variants_networked_components",
"app:analyzer_devel_public",
"app:analyzer_prod_public",
"app:cobalt_environment",
"app:shuffler_devel_public",
"app:shuffler_prod_public",
]
test_specs = {
environments = []
log_settings = {
max_severity = "ERROR"
}
}
}
fuchsia_test_component("cobalt_testapp_for_prober_do_not_run_manually") {
manifest = "meta/cobalt_testapp_for_prober_do_not_run_manually.cml"
deps = [ "testapp:cobalt_testapp" ]
}
# Tests that should be run on a schedule for probing cobalt.
# These should only be run in CQ to avoid polluting the data collected. To
# verify that this still works, use cobalt-manual-tests instead.
fuchsia_test_package("cobalt_tests_do_not_run_manually") {
test_components = [ ":cobalt_testapp_for_prober_do_not_run_manually" ]
deps = [
":variants_networked_components",
"app:analyzer_devel_public",
"app:analyzer_prod_public",
"app:cobalt_environment",
"app:shuffler_devel_public",
"app:shuffler_prod_public",
]
test_specs = {
# We don't want to run this version of cobalt_testapp in the Fuchsia
# CI/CQ because it uses the real network. We run cobalt_testapp_no_network
# instead. This version is run in the Cobalt Prober.
# It should not be run outside of CI, since it populates a test pipeline
# whose output is inspected.
environments = [
{
dimensions = {
device_type = "Astro"
}
tags = [ "cobalt-prober" ]
},
{
dimensions = {
device_type = "Intel NUC Kit NUC7i5DNHE"
}
tags = [ "cobalt-prober" ]
},
]
log_settings = {
max_severity = "ERROR"
}
}
}
fuzzers_package("cobalt_fuzzers") {
fuzzers = [
"app/fuzzer:logger_factory_fuzzer",
"app/fuzzer:logger_fuzzer",
"app/fuzzer:system_data_updater_fuzzer",
]
}