From 31b5246ebf7a95dcdc694a2b8f78f729e00f17ed Mon Sep 17 00:00:00 2001 From: Ryan Kuester Date: Tue, 26 Nov 2024 18:51:53 -0600 Subject: [PATCH] build(bazel): provide means of excluding whl_test locally (#2940) Mark whl_test as size "large", so that it, and other tests of a similar size, can be excluded with the --test_size_filters option. For even more convenience, provide a hook for developers to add local .bazlerc-style defaults and configurations in $root/bazelrc.local and ../$root/bazelrc.local. This gives a convenient means of explicitly excluding whl_test during local, incremental development runs of `bazel test ...`, while not surprising users who don't opt in, and without affecting CI. whl_test's cached result is invalidated, and the test rerun, following most git activity, because the git hash appears in the Python package's version number. This combined with its long runtime and network dependency makes it a nuisance when running `bazel test ...` incrementally during development. Of course, this test be run when developing changes that affect the package, before pushing commits to main, and in CI. BUG=see description --- .bazelrc | 4 ++++ python/tflite_micro/BUILD | 1 + 2 files changed, 5 insertions(+) diff --git a/.bazelrc b/.bazelrc index 5c8549c6b62..da85fd9e157 100644 --- a/.bazelrc +++ b/.bazelrc @@ -80,3 +80,7 @@ build:ubsan --copt -O3 build:ubsan --copt -fno-omit-frame-pointer build:ubsan --linkopt -fsanitize=undefined build:ubsan --linkopt -lubsan + +# Hooks for defining local configuration +try-import ../bazelrc.local +try-import bazelrc.local diff --git a/python/tflite_micro/BUILD b/python/tflite_micro/BUILD index 4fb096c6f9d..41f63f101a6 100644 --- a/python/tflite_micro/BUILD +++ b/python/tflite_micro/BUILD @@ -241,6 +241,7 @@ py_wheel( sh_test( name = "whl_test", + size = "large", srcs = [ "whl_test.sh", ],