1#!/bin/bash 2# Copyright 2019 The TensorFlow Authors. All Rights Reserved. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# ============================================================================== 16 17set -e 18 19# Error if we somehow forget to set the path to bazel_wrapper.py 20set -u 21BAZEL_WRAPPER_PATH=$1 22set +u 23 24# From this point on, logs can be publicly available 25set -x 26 27source tensorflow/tools/ci_build/release/common.sh 28install_bazelisk 29which bazel 30 31tag_filters="gpu,-no_gpu,-benchmark-test,-no_oss,-oss_serial,-no_gpu_presubmit,-no_cuda11""$(maybe_skip_v1)" 32 33# Get the default test targets for bazel. 34source tensorflow/tools/ci_build/build_scripts/DEFAULT_TEST_TARGETS.sh 35 36# Run bazel test command. 37"${BAZEL_WRAPPER_PATH}" \ 38 test \ 39 --profile="${KOKORO_ARTIFACTS_DIR}/profile.json.gz" \ 40 --build_event_binary_file="${KOKORO_ARTIFACTS_DIR}/build_events.pb" \ 41 --config=rbe_linux_cuda_nvcc_py39 \ 42 --config=tensorflow_testing_rbe_linux \ 43 --test_tag_filters="${tag_filters}" \ 44 --build_tag_filters="${tag_filters}" \ 45 --test_lang_filters=cc,py \ 46 -- \ 47 ${DEFAULT_BAZEL_TARGETS} -//tensorflow/lite/... 48 49# Print build time statistics, including critical path. 50bazel analyze-profile "${KOKORO_ARTIFACTS_DIR}/profile.json.gz" 51 52# Copy log to output to be available to GitHub 53ls -la "$(bazel info output_base)/java.log" 54cp "$(bazel info output_base)/java.log" "${KOKORO_ARTIFACTS_DIR}/" 55 56