From 6d67b6afc6f307b66f3f47023e9406e1b2939770 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Wed, 7 Sep 2016 16:56:05 +0100 Subject: [PATCH] Rename collected logs for easier CI viewing OpenStack-CI facilitates the ability to view compressed files on the log server if they have the suffix .txt.gz. This patch ensures that all collected log files are renamed to have a .txt suffix before compressing them. The following changes are also made: - The bindep file is also cleaned up a little to reduce unnecessary duplication. - PYTHONUNBUFFERED is set to ensure that the console log from the CI jobs are in the exact order of execution. Change-Id: I89f5734275dc2789f44b5bd9c0b45dc34c4a7a50 --- bindep.txt | 3 +-- tox.ini | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bindep.txt b/bindep.txt index 4a6fb10d..6b31dd85 100644 --- a/bindep.txt +++ b/bindep.txt @@ -41,5 +41,4 @@ pyOpenSSL [platform:rpm] python-ndg_httpsclient [platform:rpm] # Required for compressing collected log files in CI -gzip [platform:dpkg] -gzip [platform:rpm] +gzip diff --git a/tox.ini b/tox.ini index 1ab4489c..27cef8e9 100644 --- a/tox.ini +++ b/tox.ini @@ -27,6 +27,7 @@ whitelist_externals = wget setenv = VIRTUAL_ENV={envdir} + PYTHONUNBUFFERED=1 [testenv:docs] @@ -186,7 +187,8 @@ commands = && (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 '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 '$(which gzip) --best --recursive "{toxinidir}/logs/"'