Skip to content

Commit fd30125

Browse files
authored
Add flow library target and wire as dep of test_operators (pytorch#18383)
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
1 parent 0cb9f38 commit fd30125

2 files changed

Lines changed: 35 additions & 2 deletions

File tree

backends/test/suite/BUCK

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
1+
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target")
2+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
23
load(":targets.bzl", "define_common_targets")
34

4-
fbcode_target(_kind = define_common_targets,is_fbcode = True)
5+
oncall("executorch")
6+
7+
fbcode_target(
8+
_kind = runtime.python_library,
9+
name = "flow",
10+
srcs = ["flow.py"],
11+
deps = [
12+
"//executorch/backends/test/harness:tester",
13+
],
14+
)
15+
16+
fbcode_target(_kind = define_common_targets, is_fbcode = True)

backends/test/suite/operators/BUCK

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
7+
load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target")
8+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
9+
10+
oncall("executorch")
11+
12+
fbcode_target(
13+
_kind = runtime.python_library,
14+
name = "test_operators",
15+
srcs = glob(["*.py"]),
16+
deps = [
17+
"//caffe2:torch",
18+
"//executorch/backends/test/suite:flow",
19+
"fbsource//third-party/pypi/pytest:pytest",
20+
],
21+
)

0 commit comments

Comments
 (0)