From 1889953f48135451a65102b7e347b2342f846190 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Wed, 7 Sep 2016 13:07:34 +0100 Subject: [PATCH] Collect compressed logs after functional test execution This change enables log collection within the gate so that further analysis on gate tasks can be performed post build. This is very useful when debugging problems and also for investigating the consequences of patches once they've been tested. Related-Bug: #1620849 Change-Id: I2bb923ebcd73114c1199b14f9b769435596091eb --- bindep.txt | 4 ++++ tox.ini | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bindep.txt b/bindep.txt index 92448803..4a6fb10d 100644 --- a/bindep.txt +++ b/bindep.txt @@ -39,3 +39,7 @@ python-ndg-httpsclient [platform:ubuntu !platform:ubuntu-trusty] python2-pyasn1 [platform:rpm] pyOpenSSL [platform:rpm] python-ndg_httpsclient [platform:rpm] + +# Required for compressing collected log files in CI +gzip [platform:dpkg] +gzip [platform:rpm] diff --git a/tox.ini b/tox.ini index 21b8ccb2..1ab4489c 100644 --- a/tox.ini +++ b/tox.ini @@ -143,7 +143,7 @@ commands = [testenv:functional] # Ignore_errors is set to true so that the logs are collected at the -# end of the run. This will not produce a failse positive. Any +# end of the run. This will not produce a false positive. Any # exception will be mark the run as failed and exit 1 after all of # the commands have been iterated through. ignore_errors = True @@ -185,6 +185,9 @@ commands = bash -c 'grep -q "changed=0.*failed=0" /tmp/idempotence_test_output.txt \ && (echo "Idempotence test: pass" && exit 0) \ || (echo "Idempotence test: fail" && exit 1)' + bash -c 'mkdir -p {toxinidir}/logs' + bash -c 'rsync -av --ignore-errors /var/log/ /openstack/log/ {toxinidir}/logs/ || true' + bash -c '$(which gzip) --best --recursive "{toxinidir}/logs/"'