From: Erik Skultety Date: Thu, 13 Oct 2022 08:59:08 +0000 (+0200) Subject: ci: integration: Bundle only failed Avocado test results X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=5597ae9609cd2bca9a29319719de3b23e17a2e9c;p=libvirt.git ci: integration: Bundle only failed Avocado test results Latest versions of Avocado create 'by-status' symlink shortcuts to test results, IOW: # this is the main test results directory containing all data $ ls /avocado/job-results/latest/test-results/ 01-scripts_networks_050-transient-lifecycle.t 02-scripts_networks_051-transient-autostart.t ... 22-scripts_networks_400-guest-bandwidth.t by_status/ # list only the failed tests $ ls -l /avocado/job-results/latest/test-results/by-status/FAIL 19-scripts_networks_360-guest-network-vepa.t -> /avocado/job-results/latest/test-results/19-scripts_networks_360-guest-network-vepa.t Therefore, let's bundle only the failed ones, it's going to make the log artifacts more obvious when looking for libvirt errors. Signed-off-by: Erik Skultety Reviewed-by: Michal Privoznik --- diff --git a/ci/integration-template.yml b/ci/integration-template.yml index 48e71e2dd9..f01de7845d 100644 --- a/ci/integration-template.yml +++ b/ci/integration-template.yml @@ -56,10 +56,16 @@ .collect-logs: &collect-logs - set +e + - shopt -s nullglob - mkdir logs - test -d "$SCRATCH_DIR"/avocado && mkdir logs/avocado - sudo coredumpctl &>/dev/null && sudo coredumpctl info --no-pager > logs/coredumpctl.txt - sudo mv /var/log/libvirt logs/libvirt + # filter only the failed tests, omitting successful job logs + - for test_log in "$SCRATCH_DIR"/avocado/latest/test-results/by-status/{ERROR,FAIL}/*; + do + sudo mv "$(realpath $test_log)" logs/avocado; + done; - sudo chown -R $(whoami):$(whoami) logs # rename all Avocado stderr/stdout logs to *.log so that GitLab's web UI doesn't mangle the MIME type - find logs/avocado/ -type f ! -name "*.log" -exec