diff --git a/bindep.txt b/bindep.txt index 931e963d..fe589259 100644 --- a/bindep.txt +++ b/bindep.txt @@ -36,3 +36,6 @@ 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 diff --git a/tox.ini b/tox.ini index 24327386..28ed5045 100644 --- a/tox.ini +++ b/tox.ini @@ -27,6 +27,7 @@ whitelist_externals = wget setenv = VIRTUAL_ENV={envdir} + PYTHONUNBUFFERED=1 [testenv:docs] @@ -155,9 +156,17 @@ install_command = pip install -U --force-reinstall {opts} {packages} +[testenv:func_logs] +commands = + bash -c 'mkdir -p {toxinidir}/logs' + bash -c 'rsync --archive --verbose --ignore-errors /var/log/ /openstack/log/ {toxinidir}/logs/ || true' + bash -c 'find "{toxinidir}/logs/" -type f | sed "p;s|$|.txt|" | xargs -n2 mv' + bash -c 'command gzip --best --recursive "{toxinidir}/logs/"' + + [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 @@ -180,12 +189,16 @@ commands = -e "install_test_packages=True" \ -e @{toxinidir}/tests/test-vars.yml \ {toxinidir}/tests/test-swift-functional.yml -vvvv - bash -c 'mkdir -p {toxinidir}/logs' - bash -c 'rsync -av --ignore-errors /var/log/ /openstack/log/ {toxinidir}/logs/ || true' + {[testenv:func_logs]commands} # NOTE(andymccr): this will test Swift running in pypy. [testenv:func_pypy] +# Ignore_errors is set to true so that the logs are collected at the +# 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 install_command = {[testenv:func_base]install_command} deps = @@ -206,12 +219,16 @@ commands = -e @{toxinidir}/tests/test-vars.yml \ -e "swift_pypy_enabled=True" \ {toxinidir}/tests/test-swift-functional.yml -vvvv - bash -c 'mkdir -p {toxinidir}/logs' - bash -c 'rsync -av --ignore-errors /var/log/ /openstack/log/ {toxinidir}/logs/ || true' + {[testenv:func_logs]commands} # NOTE(andmccr): this will test a MR Swift deploy. [testenv:multi_reg] +# Ignore_errors is set to true so that the logs are collected at the +# 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 install_command = {[testenv:func_base]install_command} deps = @@ -266,8 +283,7 @@ commands = -e "install_test_packages=True" \ -e @{toxinidir}/tests/test-vars-MR-B.yml \ {toxinidir}/tests/test-swift-functional.yml -vvvv - bash -c 'mkdir -p {toxinidir}/logs' - bash -c 'rsync -av --ignore-errors /var/log/ /openstack/log/ {toxinidir}/logs/ || true' + {[testenv:func_logs]commands} [testenv:linters]