From 7cb7093b2ef33cc593083e9dca72746975a0f01f Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Thu, 18 Jul 2013 14:02:05 -0700 Subject: [PATCH] Grab testr logs even when testr fails. * devstack-vm-gate-wrap.sh: Do all testr log processing when we deal with the other logs. Do not depend on other scripts/functions being called to do this. Downstream scripts may exit prematurely resulting in a loss of data. * devstack-vm-gate.sh: Stop processing testr logs here. Change-Id: I24144e32f9ba7b279aaec0d3fadcfdf3bc5ef77c --- devstack-vm-gate-wrap.sh | 16 ++++++++-------- devstack-vm-gate.sh | 4 ---- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/devstack-vm-gate-wrap.sh b/devstack-vm-gate-wrap.sh index a9e7fe69..a1109616 100755 --- a/devstack-vm-gate-wrap.sh +++ b/devstack-vm-gate-wrap.sh @@ -249,14 +249,14 @@ function cleanup_host { sudo iptables-save > $WORKSPACE/logs/iptables.txt - #Copy and compress testr_results. - if [ -f $BASE/new/tempest/testr_results.html ]; then - sudo cp $BASE/new/tempest/testr_results.html $NEWLOGTARGET/ - sudo gzip -9 $NEWLOGTARGET/testr_results.html - fi - #Copy subunit log. - if [ -f $BASE/new/tempest/subunit_log.txt ]; then - sudo cp $BASE/new/tempest/subunit_log.txt $NEWLOGTARGET/ + # Process testr artifacts. + if [ -f $BASE/new/tempest/.testrepository/0 ]; then + sudo cp $BASE/new/tempest/.testrepository/0 $WORKSPACE/subunit_log.txt + sudo python /usr/local/jenkins/slave_scripts/subunit2html.py $WORKSPACE/subunit_log.txt $WORKSPACE/testr_results.html + sudo gzip -9 $WORKSPACE/subunit_log.txt + sudo gzip -9 $WORKSPACE/testr_results.html + sudo chown jenkins:jenkins $WORKSPACE/subunit_log.txt.gz $WORKSPACE/testr_results.html.gz + sudo chmod a+r $WORKSPACE/subunit_log.txt.gz $WORKSPACE/testr_results.html.gz fi # Make sure jenkins can read all the logs diff --git a/devstack-vm-gate.sh b/devstack-vm-gate.sh index 5ce44dfe..9fb6a3ee 100755 --- a/devstack-vm-gate.sh +++ b/devstack-vm-gate.sh @@ -265,10 +265,6 @@ if [ "$DEVSTACK_GATE_TEMPEST" -eq "1" ]; then echo "Running tempest smoke tests" sudo -H -u stack tox -esmoke fi - if [ -f .testrepository/0 ]; then - sudo -H -u stack cp .testrepository/0 subunit_log.txt - sudo -H -u stack python /usr/local/jenkins/slave_scripts/subunit2html.py ./subunit_log.txt testr_results.html - fi else # Jenkins expects at least one nosetests file. If we're not running # tempest, then write a fake one that indicates the tests pass (since