From 079e2213a25e28773aa9d56951905cb4256ee457 Mon Sep 17 00:00:00 2001 From: Ricardo Signes Date: Thu, 30 Jul 2026 16:22:13 -0400 Subject: [PATCH] ci: always gather logs --- lib/Dobby/Boxmate/App/Command/ciplan.pm | 1 - misc/test-runner-on-vm | 28 +++++++++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/lib/Dobby/Boxmate/App/Command/ciplan.pm b/lib/Dobby/Boxmate/App/Command/ciplan.pm index 3f8e868..8bccfbe 100644 --- a/lib/Dobby/Boxmate/App/Command/ciplan.pm +++ b/lib/Dobby/Boxmate/App/Command/ciplan.pm @@ -46,7 +46,6 @@ sub _template_program { [ newt_full => () ], # [ cassandane => () ], [ stop_services => () ], - [ log_gather => () ], ]; } diff --git a/misc/test-runner-on-vm b/misc/test-runner-on-vm index 6586e68..66ecde5 100755 --- a/misc/test-runner-on-vm +++ b/misc/test-runner-on-vm @@ -455,7 +455,7 @@ sub STEP_cassandane ($self, @args) { return; } -sub STEP_log_gather ($self) { +sub gather_logs ($self) { START("gathering logs"); my $root = $self->root; @@ -487,21 +487,31 @@ my $testproc = TestProcess->new({ my @instructions = $plan->{program}->@*; -for my $instruction (@instructions) { - my ($name, @args) = @$instruction; +eval { + for my $instruction (@instructions) { + my ($name, @args) = @$instruction; - my $method = "STEP_$name"; + my $method = "STEP_$name"; - unless ($testproc->can($method)) { - # XXX: validate all this before starting any work! - die "Test runner has no implementation for $name step\n"; + unless ($testproc->can($method)) { + # XXX: validate all this before starting any work! + die "Test runner has no implementation for $name step\n"; + } + + $testproc->$method(@args); } +}; - $testproc->$method(@args); -} +my $error = $@; FINISH_CURR(); +$self->gather_logs; + +if ($error) { + die $error; +} + if ($testproc->is_passing) { say "All tests successful!"; exit 0;