2
0
mirror of https://github.com/xcat2/xcat-dep.git synced 2026-09-30 14:55:17 +00:00

fix(xcat-dep): a bail-out in one test file stops the whole suite

BAIL_OUT stops prove for every test file, not only the one that calls
it. Twelve calls in five test files now use die, which fails only its
own file.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
Daniel Hilst
2026-09-25 11:40:39 -03:00
parent 2a47e63cdd
commit 7aa0ae858f
5 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -94,7 +94,7 @@ is($bad->{ec}, 3, 'a failing command keeps its exit status');
my $hang = drive(name => 'hang', cmd => 'exec sleep 600 >/dev/null 2>&1',
timeout => 4, sample => 2, deadline => 90);
ok($hang->{finished}, 'a hanging command does NOT hang the caller')
or BAIL_OUT('run_bounded never returned: the bound is missing, so a hung build has no failure');
or die('run_bounded never returned: the bound is missing, so a hung build has no failure');
is($hang->{timed_out}, 1, 'the hang is reported as a timeout');
is($hang->{ec}, 124, 'the timeout exit status is 124, as timeout(1) uses');
cmp_ok($hang->{wall}, '<', 60, 'it fails soon after the budget, not later');
+1 -1
View File
@@ -42,7 +42,7 @@ if (command_exists('tar')) {
}
if (@missing_requirements) {
my $message = 'requires ' . join(', ', @missing_requirements);
BAIL_OUT($message) if $ENV{XCAT_GENESIS_CI};
die($message) if $ENV{XCAT_GENESIS_CI};
plan skip_all => $message;
}
+4 -4
View File
@@ -51,9 +51,9 @@ my @APT_SUITES = qw(focal jammy noble resolute);
test_activation_helper();
if ($ENV{XCAT_GENESIS_CI}) {
BAIL_OUT('CI requires Linux root') unless $^O eq 'linux' && $> == 0;
die('CI requires Linux root') unless $^O eq 'linux' && $> == 0;
for my $command (qw(apt-ftparchive bash createrepo_c dpkg-deb gpg rpm rpmbuild)) {
BAIL_OUT("CI requires $command") unless command_exists($command);
die("CI requires $command") unless command_exists($command);
}
}
@@ -329,7 +329,7 @@ sub run_apt_consumer {
sub write_apt_manifest {
my ($path, $mutate) = @_;
my %shipped = read_manifest("$repo_root/debs-manifest.conf");
BAIL_OUT('debs-manifest.conf has no [shared] section')
die('debs-manifest.conf has no [shared] section')
unless exists $shipped{shared};
my %shared = %{ $shipped{shared} };
$mutate->(\%shared) if $mutate;
@@ -1083,7 +1083,7 @@ sub test_activation_helper {
unlike($activation, qr/XCAT_GENESIS_ROOT/,
'the root package helper has no environment-controlled execution root');
$activation =~ s/\ngenesis_activation_main "\$\@"\s*\z/\n/
or BAIL_OUT('the activation helper has no reusable main boundary');
or die('the activation helper has no reusable main boundary');
my $driver = "$tmp/activation-driver";
my $log = "$tmp/activation.log";
+1 -1
View File
@@ -49,7 +49,7 @@ my $epoch = 1787293573;
if ($ENV{XCAT_GENESIS_CI}) {
for my $command (qw(git dpkg-deb rpm rpmbuild tar)) {
BAIL_OUT("CI requires $command") unless command_exists($command);
die("CI requires $command") unless command_exists($command);
}
}
+4 -4
View File
@@ -771,7 +771,7 @@ STUB
};
my ($scan) = $src =~ /\n( my %u = \(\$arch => 1\);\n if \(\$mode eq 'publish'\) \{\n.*?\n \}\n)/ms;
BAIL_OUT('could not extract the staged-arch scan from sbuild-all.pl') unless defined $scan;
die('could not extract the staged-arch scan from sbuild-all.pl') unless defined $scan;
my $staging = tempdir( CLEANUP => 1 );
make_path("$staging/noble/$_") for qw(amd64 ppc64el riscv64 s390x);
@@ -805,7 +805,7 @@ STUB
};
my ($sub) = $src =~ /\n(sub genesis_in_manifest \{\n.*?\n\})\n/ms;
BAIL_OUT('could not extract genesis_in_manifest from sbuild-all.pl') unless defined $sub;
die('could not extract genesis_in_manifest from sbuild-all.pl') unless defined $sub;
our %MANIFEST = (
'noble-amd64' => { 'xcat-genesis-base' => '2.*', 'ipmitool-xcat' => '1.8.18-4' },
@@ -839,10 +839,10 @@ STUB
};
my ($sub) = $src =~ /\n(sub ensure_foreign_arch_support \{\n.*?\n\})\n/ms;
BAIL_OUT('could not extract ensure_foreign_arch_support from sbuild-all.pl') unless defined $sub;
die('could not extract ensure_foreign_arch_support from sbuild-all.pl') unless defined $sub;
my ($map) = $src =~ /\n(my %BINFMT_HANDLER = \(.*?\);)\n/ms;
BAIL_OUT('could not extract the binfmt handler map') unless defined $map;
die('could not extract the binfmt handler map') unless defined $map;
my $fake = tempdir( CLEANUP => 1 );
( my $driver = "$map\n$sub" ) =~ s{/proc/sys/fs/binfmt_misc}{$fake}g;