-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest.sh
executable file
·32 lines (24 loc) · 1.01 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
set -e
# This script will build the Timeseria container and run the tests into it
# Build
if [[ "x$BUILD" != "xFalse" ]]; then
echo -e "\n===================================="
echo -e "| Building the Docker container |"
echo -e "====================================\n"
cd docker/
echo "Building Timeseria Docker container. Use BUILD=False to skip."
./build.sh
cd ../
fi
# Run the tests
echo -e "\n===================================="
echo -e "| Running tests in the container |"
echo -e "====================================\n"
# Reduce verbosity, disable Python buffering and set the log level
ENV_VARS="PYTHONWARNINGS=ignore TF_CPP_MIN_LOG_LEVEL=3 PYTHONUNBUFFERED=on TIMESERIA_LOGLEVEL=$TIMESERIA_LOGLEVEL"
if [ $# -eq 0 ]; then
docker run -v $PWD:/opt/Timeseria -it timeseria "date && cd /opt/Timeseria && $ENV_VARS python3 -m unittest discover"
else
docker run -v $PWD:/opt/Timeseria -it timeseria "date && cd /opt/Timeseria && $ENV_VARS python3 -m unittest $@"
fi