From 57aa44502fa25c3305c90682dd646e9a374fe896 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Wed, 19 Jul 2017 08:44:50 -0700 Subject: [PATCH] Generate Tempest results in HTML 1) Generate HTML page from Tempest results, using subunit2html 2) Compress and expose both subunit & HTML results into logdir Change-Id: I111eb8417428ce2027d21ccdcdfd10dc30d509ac --- copy_logs.sh | 6 +++++- run_tests.sh | 13 +++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/copy_logs.sh b/copy_logs.sh index 4653f9d74..d30d6decb 100755 --- a/copy_logs.sh +++ b/copy_logs.sh @@ -106,7 +106,11 @@ fi # Tempest subunit results if [ -f /tmp/openstack/tempest/testrepository.subunit ] ; then - sudo cp /tmp/openstack/tempest/testrepository.subunit $LOG_DIR/testrepository.subunit + for f in testrepository.subunit testr_results.html; + do + sudo cp /tmp/openstack/tempest/$f $LOG_DIR/$f + sudo gzip -9 $LOG_DIR/$f + done fi # dstat logs diff --git a/run_tests.sh b/run_tests.sh index 7bbacaa6c..b4ee3ef5a 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -255,10 +255,10 @@ print_header 'Prepare Tempest' $SUDO touch /tmp/openstack/tempest/test-whitelist.txt $SUDO chown -R "$(id -u):$(id -g)" /tmp/openstack/tempest/test-whitelist.txt - # install from source now on ubuntu until packaged if uses_debs; then cd /tmp/openstack/tempest-horizon; $SUDO python setup.py install + $SUDO pip install -U testrepository os-testr fi set +e @@ -321,24 +321,17 @@ if [ "${TEMPEST_FROM_SOURCE}" = true ]; then run_tempest/bin/pip install -c https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt -U -r requirements.txt run_tempest/bin/python setup.py install export tempest_binary="run_tempest/bin/tempest" - export testr_binary="run_tempest/bin/testr" else export tempest_binary="/usr/bin/tempest" - export testr_binary="/usr/bin/testr" fi # Run tempest commands $tempest_binary run --whitelist_file=/tmp/openstack/tempest/test-whitelist.txt --concurrency=2 $EXCLUDES RESULT=$? set -e -if uses_debs; then - $SUDO pip install -U testrepository - testr last --subunit > /tmp/openstack/tempest/testrepository.subunit -elif is_fedora; then - $testr_binary last --subunit > /tmp/openstack/tempest/testrepository.subunit -fi $tempest_binary list-plugins - +testr last --subunit > /tmp/openstack/tempest/testrepository.subunit +subunit2html /tmp/openstack/tempest/testrepository.subunit /tmp/openstack/tempest/testr_results.html print_header 'SELinux Alerts (Tempest)' catch_selinux_alerts