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"
37 echo "Running unittest ... "
38 if [ $FILE_OPTION == "f" ]; then
39 python -m unittest discover -v -s tests/unit > $logfile 2>&1
41 python -m unittest discover -v -s tests/unit
45 if [ $FILE_OPTION == "f" ]; then
46 echo "FAILED, results in $logfile"
50 if [ $FILE_OPTION == "f" ]; then
51 echo "OK, results in $logfile"
57 source tests/ci/cover.sh
61 run_functional_test() {
63 mkdir -p .testrepository
64 python -m subunit.run discover tests/functional > .testrepository/subunit.log
66 subunit2pyunit < .testrepository/subunit.log
68 subunit-stats < .testrepository/subunit.log
70 if [ $EXIT_CODE -ne 0 ]; then
77 export PYTHONPATH='yardstick/vTC/apexlake'