From c59e54f607f6c3b8e34f6c0e24d801949fd1fe0c Mon Sep 17 00:00:00 2001 From: RJ Ascani Date: Fri, 20 Mar 2026 14:02:29 -0700 Subject: [PATCH] Add flow library target and wire as dep of test_operators Summary: The test_operators library target globs all operator test files, but those files import TestFlow from executorch.backends.test.suite.flow which had no Buck target owner. This caused listing failures for any downstream consumer of test_operators. Add a flow library target in test/suite/BUCK and add it as a dep of test_operators (migrated from TARGETS to BUCK with fbcode_target). This diff was authored with Claude. Differential Revision: D97333154 --- backends/test/suite/BUCK | 16 ++++++++++++++-- backends/test/suite/operators/BUCK | 21 +++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 backends/test/suite/operators/BUCK diff --git a/backends/test/suite/BUCK b/backends/test/suite/BUCK index 18a7fe3324a..fd2d7416389 100644 --- a/backends/test/suite/BUCK +++ b/backends/test/suite/BUCK @@ -1,4 +1,16 @@ -load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load(":targets.bzl", "define_common_targets") -fbcode_target(_kind = define_common_targets,is_fbcode = True) +oncall("executorch") + +fbcode_target( + _kind = runtime.python_library, + name = "flow", + srcs = ["flow.py"], + deps = [ + "//executorch/backends/test/harness:tester", + ], +) + +fbcode_target(_kind = define_common_targets, is_fbcode = True) diff --git a/backends/test/suite/operators/BUCK b/backends/test/suite/operators/BUCK new file mode 100644 index 00000000000..83ca2b1d597 --- /dev/null +++ b/backends/test/suite/operators/BUCK @@ -0,0 +1,21 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + +oncall("executorch") + +fbcode_target( + _kind = runtime.python_library, + name = "test_operators", + srcs = glob(["*.py"]), + deps = [ + "//caffe2:torch", + "//executorch/backends/test/suite:flow", + "fbsource//third-party/pypi/pytest:pytest", + ], +)