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
This commit is contained in:
Jesse Pretorius 2016-09-07 13:07:34 +01:00
parent e58ae245ad
commit 1889953f48
2 changed files with 8 additions and 1 deletions

View File

@ -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]

View File

@ -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/"'