Skip to content

Commit

Permalink
ci(bazel): improve logging of bazel CI tests (tensorflow#2749)
Browse files Browse the repository at this point in the history
Improve the logging of Bazel commands run in CI by setting several
options that turn off, e.g., progress messages intended for interactive
shells, and turn on, e.g., more verbose output when something fails.

BUG=tensorflow#2742
  • Loading branch information
rkuester authored Nov 12, 2024
1 parent 9245002 commit 79c3fde
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ build --cxxopt -std=c++17
# Treat warnings as errors
build --copt -Werror

# Common options for --config=ci
build:ci --curses=no
build:ci --color=no
build:ci --noshow_progress
build:ci --noshow_loading_progress
build:ci --show_timestamps
build:ci --terminal_columns=0
build:ci --verbose_failures

# When building with the address sanitizer
# E.g., bazel build --config asan
build:asan --repo_env CC=clang
Expand Down
3 changes: 3 additions & 0 deletions tensorflow/lite/micro/tools/ci_build/test_bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# ==============================================================================

set -e
set -x

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR=${SCRIPT_DIR}/../../../../..
Expand All @@ -27,8 +28,10 @@ source tensorflow/lite/micro/tools/ci_build/helper_functions.sh
# having build_test but that was removed with #194.

CC=clang readable_run bazel build ... \
--config=ci \
--build_tag_filters=-no_oss
CC=clang readable_run bazel test ... \
--config=ci \
--test_tag_filters=-no_oss --build_tag_filters=-no_oss \
--test_output=errors

Expand Down
4 changes: 4 additions & 0 deletions tensorflow/lite/micro/tools/ci_build/test_bazel_asan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# ==============================================================================

set -e
set -x

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR=${SCRIPT_DIR}/../../../../..
Expand All @@ -27,8 +28,11 @@ source tensorflow/lite/micro/tools/ci_build/helper_functions.sh
# having build_test but that was removed with #194.

CC=clang readable_run bazel build tensorflow/lite/micro/... \
--config=ci \
--config=asan --build_tag_filters=-no_oss,-noasan

CC=clang readable_run bazel test tensorflow/lite/micro/... \
--config=ci \
--config=asan \
--test_tag_filters=-no_oss,-noasan --build_tag_filters=-no_oss,-noasan \
--test_output=errors
4 changes: 4 additions & 0 deletions tensorflow/lite/micro/tools/ci_build/test_bazel_msan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# ==============================================================================

set -e
set -x

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR=${SCRIPT_DIR}/../../../../..
Expand All @@ -27,8 +28,11 @@ source tensorflow/lite/micro/tools/ci_build/helper_functions.sh
# having build_test but that was removed with #194.

CC=clang readable_run bazel build tensorflow/lite/micro/... \
--config=ci \
--config=msan --build_tag_filters=-no_oss,-nomsan

CC=clang readable_run bazel test tensorflow/lite/micro/... \
--config=ci \
--config=msan \
--test_tag_filters=-no_oss,-nomsan --build_tag_filters=-no_oss,-nomsan \
--test_output=errors
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# ==============================================================================

set -e
set -x

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR=${SCRIPT_DIR}/../../../../..
Expand All @@ -23,4 +24,5 @@ cd "${ROOT_DIR}"
source tensorflow/lite/micro/tools/ci_build/helper_functions.sh

readable_run bazel test tensorflow/lite/tools/... \
--config=ci \
--test_output=errors

0 comments on commit 79c3fde

Please sign in to comment.