aboutsummaryrefslogtreecommitdiff
path: root/tempest/tempest-run.sh
blob: a1c62d9a373e941ab67e6419f0797840194f8cd6 (plain)
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
33
34
35
36
37
#!/bin/bash

if [[ "$LAVA_RUN_TEMPEST" != "yes" ]]; then
    exit 0
fi

: ${TEMPEST_OUTER_OUTPUT_DIR:?error}

od=$TEMPEST_OUTER_OUTPUT_DIR	# readability

pushd /opt/stack/tempest
source .tox/full/bin/activate
set -x

if [ ! -d .testrepository ]; then
    testr init
fi

mkdir -p $od
cp etc/tempest.conf $od/tempest_conf.txt
testr list-tests | grep '^tempest' > $od/all-tests.txt
test_file=$(mktemp)

if [ -z "$LAVA_TESTS_TO_RUN" ]; then
    cp $od/all-tests.txt $test_file
else
    echo "$LAVA_TESTS_TO_RUN" | tr ' ' '\n' | while read; do echo $REPLY >> $test_file; done
fi

export TOX_PROGRESS_NLINES=$(cat $test_file | wc -l)
testr run --subunit --load-list=$test_file --concurrency=${LAVA_TEMPEST_CONCURRENCY:-1} | subunit-trace --no-failure-debug
rm $test_file

testr last --subunit > $od/results.subunit
cat $od/results.subunit | subunit2csv --no-passthrough > $od/results.csv
cat $od/results.subunit | subunit-filter -F | subunit-ls --no-passthrough > $od/failing-tests.txt
cat $od/results.subunit | gzip > $od/results.subunit.gz