|
| 1 | +#!/usr/bin/env 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 | +# ============================================================================== |
| 17 | +# Make sure we're in the project root path. |
| 18 | +SCRIPT_DIR=$( cd ${0%/*} && pwd -P ) |
| 19 | +ROOT_DIR=$( cd "$SCRIPT_DIR/.." && pwd -P ) |
| 20 | +if [[ ! -d "tensorflow_addons" ]]; then |
| 21 | + echo "ERROR: PWD: $PWD is not project root" |
| 22 | + exit 1 |
| 23 | +fi |
| 24 | + |
| 25 | +set -x |
| 26 | + |
| 27 | +N_JOBS=$(grep -c ^processor /proc/cpuinfo) |
| 28 | + |
| 29 | +echo "" |
| 30 | +echo "Bazel will use ${N_JOBS} concurrent job(s)." |
| 31 | +echo "" |
| 32 | + |
| 33 | +export CC_OPT_FLAGS='-mavx' |
| 34 | +export TF_NEED_CUDA=1 |
| 35 | + |
| 36 | +export PYTHON_BIN_PATH=`which python` |
| 37 | +# Use default configuration here. |
| 38 | +yes 'y' | ./configure.sh |
| 39 | + |
| 40 | +## Run bazel test command. Double test timeouts to avoid flakes. |
| 41 | +bazel test -c opt -k \ |
| 42 | + --jobs=${N_JOBS} --test_timeout 300,450,1200,3600 \ |
| 43 | + --test_output=errors --local_test_jobs=8 \ |
| 44 | + //tensorflow_addons/... |
| 45 | + |
| 46 | +exit $? |
0 commit comments