From 884dd8d3c1ad8250c6f43ecbf46b0b7ff2d77b69 Mon Sep 17 00:00:00 2001 From: ybonatakis Date: Mon, 16 Sep 2024 11:21:21 +0200 Subject: [PATCH] Upload full openqa job testresults Compress and upload the testresults directory and the running processes for investigation. https://progress.opensuse.org/issues/166445 Signed-off-by: ybonatakis Signed-off-by: Ioannis Bonatakis --- lib/openQAcoretest.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/openQAcoretest.pm b/lib/openQAcoretest.pm index 49acca58..076e517d 100644 --- a/lib/openQAcoretest.pm +++ b/lib/openQAcoretest.pm @@ -28,11 +28,14 @@ sub post_fail_hook ($self) { sub test_flags { {fatal => 1} } sub upload_openqa_logs { + get_log 'ps -ef' => 'running_processes.txt'; get_log 'journalctl --pager-end --no-tail --no-pager -u apache2 -u nginx -u openqa-scheduler -u openqa-websockets -u openqa-webui -u openqa-gru -u openqa-worker@1' => 'openqa_services.log.txt'; get_log 'journalctl --pager-end --no-tail --no-pager' => 'journal.log.txt'; my @logs = split m/\n/, script_output q{find /var/lib/openqa -name autoinst-log.txt}; @logs and get_log "(cat @logs ||:)" => 'autoinst-log.txt'; get_log '(find /var/lib/openqa/pool/ /var/lib/openqa/testresults/ ||:)' => 'find.txt'; + assert_script_run 'tar -cvzf testresults.tar.gz /var/lib/openqa/testresults/'; + upload_logs 'testresults.tar.gz'; get_log q|sudo -u geekotest /usr/share/openqa/script/openqa eval -V 'my $jobs = app->minion->jobs; my @r; while (my $j = $jobs->next) { push @r, $j->{result} }; \@r'| => 'openqa_minion_results.txt'; }