3 ##############################################################################
4 # Copyright (c) 2015 Ericsson AB and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
12 # Run yardstick's flake8, unit, coverage, functional test
14 getopts ":f" FILE_OPTION
17 echo "Running flake8 ... "
18 logfile=test_results.log
19 if [ $FILE_OPTION == "f" ]; then
20 flake8 yardstick > $logfile
27 if [ $FILE_OPTION == "f" ]; then
28 echo "Results in $logfile"
38 echo "Get external libs needed for unit test"
40 echo "Running unittest ... "
41 if [ $FILE_OPTION == "f" ]; then
42 python -m unittest discover -v -s tests/unit > $logfile 2>&1
44 python -m unittest discover -v -s tests/unit
48 if [ $FILE_OPTION == "f" ]; then
49 echo "FAILED, results in $logfile"
53 if [ $FILE_OPTION == "f" ]; then
54 echo "OK, results in $logfile"
60 source tests/ci/cover.sh
64 run_functional_test() {
66 mkdir -p .testrepository
67 python -m subunit.run discover tests/functional > .testrepository/subunit.log
69 subunit2pyunit < .testrepository/subunit.log
71 subunit-stats < .testrepository/subunit.log
73 if [ $EXIT_CODE -ne 0 ]; then
80 export PYTHONPATH='yardstick/vTC/apexlake'