Skip to content

Commit c7db9b9

Browse files
authored
cover //kernels/prim_ops/... in unittest-buck (#9176)
Everything but the Python test (which depends on //caffe2:torch) is fine.
1 parent 8334bb6 commit c7db9b9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.ci/scripts/unittest-buck2.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ buck2 query "//backends/apple/... + //backends/example/... + \
1919

2020
UNBUILDABLE_OPTIMIZED_OPS_REGEX="gelu|fft_r2c|log_softmax"
2121
BUILDABLE_OPTIMIZED_OPS=$(buck2 query //kernels/optimized/cpu/... | grep -E -v $UNBUILDABLE_OPTIMIZED_OPS_REGEX)
22+
23+
BUILDABLE_KERNELS_PRIM_OPS_TARGETS=$(buck2 query //kernels/prim_ops/... | grep -v prim_ops_test_py)
2224
# TODO: expand the covered scope of Buck targets.
2325
# //runtime/kernel/... is failing because //third-party:torchgen_files's shell script can't find python on PATH.
2426
# //runtime/test/... requires Python torch, which we don't have in our OSS buck setup.
25-
buck2 test $BUILDABLE_OPTIMIZED_OPS //kernels/portable/... //runtime/backend/... //runtime/core/... \
27+
buck2 test $BUILDABLE_OPTIMIZED_OPS //kernels/portable/... \
28+
$BUILDABLE_KERNELS_PRIM_OPS_TARGETS //runtime/backend/... //runtime/core/... \
2629
//runtime/executor: //runtime/kernel/... //runtime/platform/...

kernels/prim_ops/test/TARGETS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest")
1+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
22

33
# Any targets that should be shared between fbcode and xplat must be defined in
44
# targets.bzl. This file can contain fbcode-only targets.
@@ -17,7 +17,7 @@ python_unittest(
1717
],
1818
)
1919

20-
cpp_unittest(
20+
runtime.cxx_test(
2121
name = "prim_ops_test_cpp",
2222
srcs = [
2323
"prim_ops_test.cpp",
@@ -31,6 +31,6 @@ cpp_unittest(
3131
"//executorch/runtime/kernel:kernel_runtime_context", # @manual
3232
"//executorch/runtime/kernel:operator_registry",
3333
"//executorch/runtime/platform:platform",
34-
"//executorch/test/utils:utils_aten",
34+
"//executorch/test/utils:utils",
3535
],
3636
)

0 commit comments

Comments
 (0)