From ea0964eeef9ee23f060391e3ded00d4067ae2781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Mon, 23 Apr 2018 08:18:39 +0200 Subject: [PATCH] buildinstall: Use metadata if skipped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the phase is skipped, it could mean that we are doing a debug run and we don't want to mess up the .treefile by missing arch specific images. The other alternative is that the phase was really skipped, in which case there will be no files generated and we already handle that fine. Signed-off-by: Lubomír Sedlář --- pungi/phases/buildinstall.py | 6 +++++- tests/test_buildinstall.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pungi/phases/buildinstall.py b/pungi/phases/buildinstall.py index 2e9973ce..007233ce 100644 --- a/pungi/phases/buildinstall.py +++ b/pungi/phases/buildinstall.py @@ -182,7 +182,11 @@ class BuildinstallPhase(PhaseBase): self.pool.start() def succeeded(self, variant, arch): - return (variant.uid if self.used_lorax else None, arch) in self.pool.finished_tasks + # If the phase is skipped, we can treat it as successful. Either there + # will be no output, or it's a debug run of compose where anything can + # happen. + return (super(BuildinstallPhase, self).skip() + or (variant.uid if self.used_lorax else None, arch) in self.pool.finished_tasks) def copy_files(self): disc_type = self.compose.conf['disc_types'].get('dvd', 'dvd') diff --git a/tests/test_buildinstall.py b/tests/test_buildinstall.py index 19b9b8b9..c930f589 100644 --- a/tests/test_buildinstall.py +++ b/tests/test_buildinstall.py @@ -31,6 +31,8 @@ class BuildInstallCompose(DummyCompose): } self.all_variants = self.variants.copy() self.has_comps = True + self.just_phases = [] + self.skip_phases = [] class TestBuildinstallPhase(PungiTestCase):