gather: Improve logging for gathering

Adding arch and variant to log message to make it clearer.

JIRA: COMPOSE-4009
Signed-off-by: Haibo Lin <hlin@redhat.com>
This commit is contained in:
Haibo Lin 2019-12-16 11:07:53 +08:00 committed by lsedlar
parent 9b101d554f
commit 12828849d6
5 changed files with 40 additions and 4 deletions

View file

@ -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)
)
]
)

View file

@ -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