File: pkgos-testr

package info (click to toggle)
openstack-pkg-tools 139
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 940 kB
  • sloc: sh: 4,216; makefile: 31
file content (29 lines) | stat: -rwxr-xr-x 647 bytes parent folder | download | duplicates (7)
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
#!/bin/bash

set -e

PYTHON=${1}
if [ -z "$PYTHON" ]; then
    echo "ERROR: Missing python version argument"
    echo "Usage: pkgos-testr <python-version> [<test-scope>]"
    exit 1
fi

PY_MAJOR=$(echo $PYTHON | cut -d . -f 1)
SCOPE=${2}

TEMP_REZ=`mktemp -t`

function finish {
    rm -rf .testrepository
    rm -f $TEMP_REZ
}
trap finish EXIT

echo "===> Testing for python$PYTHON"
rm -rf .testrepository
testr init
PYTHON=python$PYTHON PYTHONPATH=`pwd` testr run --subunit  $SCOPE | tee $TEMP_REZ | subunit2pyunit
cat $TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats
testr slowest
echo "===> Testing with python$PYTHON complete."