| # Copyright 2026 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. | |
| load("//build/bazel/platforms:constraints.bzl", "HOST_OS_CONSTRAINTS") | |
| load("//build/bazel/rules/host_tests:host_rustc_test.bzl", "host_rustc_test") | |
| load("//build/bazel/rules/rust:rustc_library.bzl", "rustc_library") | |
| package(default_applicable_licenses = ["//:license"]) | |
| test_suite( | |
| name = "tests", | |
| tests = [":ffx_agent_lib_test"], | |
| visibility = ["//src/developer/ffx:__pkg__"], | |
| ) | |
| rustc_library( | |
| name = "lib", | |
| srcs = [ | |
| "src/error.rs", | |
| "src/lib.rs", | |
| "src/lock.rs", | |
| "src/session.rs", | |
| "src/tests.rs", | |
| ], | |
| crate_name = "ffx_agent", | |
| edition = "2024", | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| visibility = ["//src/developer/ffx:__subpackages__"], | |
| deps = [ | |
| "//src/developer/ffx/config:lib", | |
| "//src/lib/agents:lib", | |
| "//third_party/rust_crates/vendor:nix", | |
| "//third_party/rust_crates/vendor:tempfile", | |
| "//third_party/rust_crates/vendor:thiserror", | |
| ], | |
| ) | |
| # Needs reviewer attention (bazel2gn skip): agent is listed in | |
| # tests_migrated_ffx_libraries, so this test runs in Bazel via | |
| # //src/developer/ffx:tests and a GN copy would never run in CQ. | |
| # @bazel2gn:skip | |
| host_rustc_test( | |
| name = "ffx_agent_lib_test", | |
| crate = ":lib", | |
| deps = [ | |
| "//src/lib/fuchsia", | |
| "//third_party/rust_crates/vendor:assert_matches", | |
| "//third_party/rust_crates/vendor:pretty_assertions", | |
| "//third_party/rust_crates/vendor:serde_json", | |
| ], | |
| ) |