diff --git a/pungi/phases/gather/__init__.py b/pungi/phases/gather/__init__.py index 9d54f155..86f74678 100644 --- a/pungi/phases/gather/__init__.py +++ b/pungi/phases/gather/__init__.py @@ -223,7 +223,8 @@ def gather_packages(compose, arch, variant, package_sets, fulltree_excludes=None GatherMethod = get_gather_method(method_name) method = GatherMethod(compose) method.source_name = source_name - compose.log_debug("Gathering source %s, method %s" % (source_name, method_name)) + compose.log_debug( + "Gathering source %s, method %s (arch: %s, variant: %s)" % (source_name, method_name, arch, variant)) pkg_map = method(arch, variant, packages, groups, filter_packages, multilib_whitelist, multilib_blacklist, package_sets, fulltree_excludes=fulltree_excludes, diff --git a/pungi/phases/gather/methods/method_deps.py b/pungi/phases/gather/methods/method_deps.py index 285564d8..b13effbf 100644 --- a/pungi/phases/gather/methods/method_deps.py +++ b/pungi/phases/gather/methods/method_deps.py @@ -201,5 +201,6 @@ def check_deps(compose, arch, variant, missing_deps): if missing_deps: for pkg in sorted(missing_deps): - compose.log_error("Unresolved dependencies in package %s: %s" % (pkg, sorted(missing_deps[pkg]))) + compose.log_error( + "Unresolved dependencies for %s.%s in package %s: %s" % (variant, arch, pkg, sorted(missing_deps[pkg]))) raise RuntimeError("Unresolved dependencies detected") diff --git a/pungi/phases/gather/methods/method_hybrid.py b/pungi/phases/gather/methods/method_hybrid.py index 0deedd77..9852f017 100644 --- a/pungi/phases/gather/methods/method_hybrid.py +++ b/pungi/phases/gather/methods/method_hybrid.py @@ -268,10 +268,10 @@ class GatherMethodHybrid(pungi.phases.gather.method.GatherMethodBase): env = os.environ.copy() env["G_MESSAGES_PREFIXED"] = "" env["XDG_CACHE_HOME"] = cache_dir - self.compose.log_debug("[BEGIN] Running fus") + self.compose.log_debug("[BEGIN] Running fus (arch: %s, variant: %s)" % (arch, variant)) run(cmd, logfile=logfile, show_cmd=True, env=env) output, out_modules = fus.parse_output(logfile) - self.compose.log_debug("[DONE ] Running fus") + self.compose.log_debug("[DONE ] Running fus (arch: %s, variant: %s)" % (arch, variant)) # No need to resolve modules again. They are not going to change. modules = [] # Reset input packages as well to only solve newly added things. diff --git a/tests/test_gather_method_deps.py b/tests/test_gather_method_deps.py index d3f04eb9..2de8c8c2 100644 --- a/tests/test_gather_method_deps.py +++ b/tests/test_gather_method_deps.py @@ -112,3 +112,30 @@ class TestRaiseOnInvalidSigkeys(helpers.PungiTestCase): } with self.assertRaises(RuntimeError): deps.raise_on_invalid_sigkeys('', '', [pkgset], result) + +class TestCheckDeps(helpers.PungiTestCase): + + def setUp(self): + super(TestCheckDeps, self).setUp() + self.compose = helpers.DummyCompose(self.topdir, {}) + self.arch = 'x86_64' + self.variant = self.compose.variants['Server'] + + def test_not_check_deps(self): + self.compose.conf["check_deps"] = False + self.assertIsNone(deps.check_deps(self.compose, self.arch, self.variant, {})) + + def test_missing_deps(self): + self.compose.conf["check_deps"] = True + missing_deps = {'foo.noarch': set(['bar = 1.1'])} + with self.assertRaises(RuntimeError) as ctx: + deps.check_deps(self.compose, self.arch, self.variant, missing_deps) + self.assertEqual(str(ctx.exception), 'Unresolved dependencies detected') + self.assertEqual( + self.compose.log_error.call_args_list, + [ + mock.call( + "Unresolved dependencies for %s.%s in package foo.noarch: ['bar = 1.1']" % (self.variant, self.arch) + ) + ] + ) diff --git a/tests/test_gather_method_hybrid.py b/tests/test_gather_method_hybrid.py index 68570315..8cfb225f 100644 --- a/tests/test_gather_method_hybrid.py +++ b/tests/test_gather_method_hybrid.py @@ -365,6 +365,13 @@ class TestRunSolver(HelperMixin, helpers.PungiTestCase): ) ], ) + self.assertEqual( + self.compose.log_debug.call_args_list, + [ + mock.call('[BEGIN] Running fus (arch: x86_64, variant: Server)'), + mock.call('[DONE ] Running fus (arch: x86_64, variant: Server)') + ] + ) def test_with_modules_with_devel(self, run, gc, po, wc): self.compose.has_comps = False