From 5ab387fb7e4d6922c17a09e25db76fa2cf8f13df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Mon, 24 Aug 2026 13:45:43 -0300 Subject: [PATCH] test(genesis): cover the staging repository reset A package left in the staging repository by an earlier run is invisible to collection but visible to createrepo and deploy. Pin that the run clears it, so the empty-collection guard cannot be satisfied by an earlier invocation's output. --- t/genesis_openembedded_consumer.t | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/t/genesis_openembedded_consumer.t b/t/genesis_openembedded_consumer.t index b99ab13..0174230 100644 --- a/t/genesis_openembedded_consumer.t +++ b/t/genesis_openembedded_consumer.t @@ -49,7 +49,7 @@ if ($ENV{XCAT_GENESIS_CI}) { } SKIP: { - skip 'RPM repository tools require a root Linux builder', 26 + skip 'RPM repository tools require a root Linux builder', 27 unless $^O eq 'linux' && $> == 0 && command_exists('rpmbuild') @@ -358,7 +358,10 @@ sub test_failed_build_release { my $deployed = "$output/xcat-dep/rh10/" . capture_command('uname', '-m'); my $scratch_repo_root = "$tmp/rpm-empty-root"; my $collected = "$tmp/rpm-empty-collect"; - make_path($deployed, $scratch_repo_root, $collected); + my $run_repo = "$output/mockbuild-all/$target-empty/repo/" . capture_command('uname', '-m'); + my $stale = "$run_repo/ipmitool-xcat-0-stale.noarch.rpm"; + make_path($deployed, $scratch_repo_root, $collected, $run_repo); + write_binary($stale, 'package left by an earlier run'); my $log = "$tmp/rpm-empty.log"; my $status = run_capture( @@ -380,6 +383,8 @@ sub test_failed_build_release { 'the failure names the empty collection, not the missing dependencies'); ok(!-e "$deployed/$package", 'a run that built nothing publishes no release package'); + ok(!-e $stale, + 'a package left by an earlier run is cleared from the staging repository'); } sub test_dry_run_release {