From 270e77c106fadee44ee11fdab8679b566b783a27 Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Thu, 8 Mar 2018 13:43:25 -0600 Subject: [PATCH] Archive ARA report on successful jobs This patch ensures that the ARA reports are run on successful jobs but the results are put into a tarball. This should allow quicker access to ARA reports without consuming lots of inodes on OpenStack's CI infrastructure. Change-Id: I68da890578c98a60e321d8e112a04980e01560a1 Signed-off-by: Major Hayden --- scripts/scripts-library.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/scripts-library.sh b/scripts/scripts-library.sh index e539cf7b66..ec6de6bfe9 100755 --- a/scripts/scripts-library.sh +++ b/scripts/scripts-library.sh @@ -161,14 +161,15 @@ function gate_job_exit_tasks { mkdir ${GATE_LOG_DIR}/ara rsync $RSYNC_OPTS "${HOME}/.ara/ansible.sqlite" "${GATE_LOG_DIR}/ara/" - # In order to reduce the quantity of unnecessary log content - # being kept in OpenStack-Infra we only generate the ARA report - # when the test result is a failure. - if [[ "${TEST_EXIT_CODE}" != "0" ]] && [[ "${TEST_EXIT_CODE}" != "true" ]]; then - echo "Generating ARA report due to non-zero exit code (${TEST_EXIT_CODE})." - ${ARA_CMD} generate html "${GATE_LOG_DIR}/ara" || true - else - echo "Not generating ARA report due to test pass." + # To avoid consuming lots of inodes in OpenStack's CI infra, we tar up + # the ARA report when we have a successful job. + ${ARA_CMD} generate html "${GATE_LOG_DIR}/ara/" || true + if [[ "${TEST_EXIT_CODE}" == "0" ]] || [[ "${TEST_EXIT_CODE}" == "true" ]]; then + pushd $GATE_LOG_DIR + tar cvf ara-report.tar ara/ + rm -rf ara/* + mv ara-report.tar ara/ + popd fi # We still want the subunit report though, as that reflects # success/failure in OpenStack Health