~rackspace-titan/nova/api-profiling

« back to all changes in this revision

Viewing changes to run_tests.sh

  • Committer: Tarmac
  • Author(s): Rick Harris
  • Date: 2011-06-15 13:31:02 UTC
  • mfrom: (1176.3.6 test_times)
  • Revision ID: tarmac-20110615133102-vxh1h7f9tfgc388d
Adds code to run_tests.py which:

  * Prints the time taken to run each test
  * Prints the 5 slowest tests at the end of the test-run
  * Adds --hide-elapsed option to suppress elapsed time output

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
  echo "  -f, --force              Force a clean re-build of the virtual environment. Useful when dependencies have been added."
11
11
  echo "  -p, --pep8               Just run pep8"
12
12
  echo "  -h, --help               Print this usage message"
 
13
  echo "  --hide-elapsed           Don't print the elapsed time for each test along with slow test list"
13
14
  echo ""
14
15
  echo "Note: with no options specified, the script will try to run the tests in a virtual environment,"
15
16
  echo "      If no virtualenv is found, the script will ask if you would like to create one.  If you "
24
25
    -N|--no-virtual-env) let always_venv=0; let never_venv=1;;
25
26
    -f|--force) let force=1;;
26
27
    -p|--pep8) let just_pep8=1;;
 
28
    -*) noseopts="$noseopts $1";;
27
29
    *) noseargs="$noseargs $1"
28
30
  esac
29
31
}
34
36
never_venv=0
35
37
force=0
36
38
noseargs=
 
39
noseopts=
37
40
wrapper=""
38
41
just_pep8=0
39
42
 
72
75
  --exclude=vcsversion.py ${srcfiles}
73
76
}
74
77
 
75
 
NOSETESTS="python run_tests.py $noseargs"
 
78
NOSETESTS="python run_tests.py $noseopts $noseargs"
76
79
 
77
80
if [ $never_venv -eq 0 ]
78
81
then
107
110
 
108
111
run_tests || exit
109
112
 
110
 
# Also run pep8 if no options were provided.
 
113
# NOTE(sirp): we only want to run pep8 when we're running the full-test suite,
 
114
# not when we're running tests individually. To handle this, we need to
 
115
# distinguish between options (noseopts), which begin with a '-', and
 
116
# arguments (noseargs).
111
117
if [ -z "$noseargs" ]; then
112
118
  run_pep8
113
119
fi