Update from upstream #11
@ -81,6 +81,7 @@ class CreaterepoPhase(PhaseBase):
|
|||||||
get_dir_from_scm(
|
get_dir_from_scm(
|
||||||
self.compose.conf["createrepo_extra_modulemd"][variant.uid],
|
self.compose.conf["createrepo_extra_modulemd"][variant.uid],
|
||||||
self.compose.paths.work.tmp_dir(variant=variant, create_dir=False),
|
self.compose.paths.work.tmp_dir(variant=variant, create_dir=False),
|
||||||
|
compose=self.compose,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.pool.queue_put((self.compose, None, variant, "srpm"))
|
self.pool.queue_put((self.compose, None, variant, "srpm"))
|
||||||
@ -363,7 +364,7 @@ def get_productids_from_scm(compose):
|
|||||||
|
|
||||||
tmp_dir = compose.mkdtemp(prefix="pungi_")
|
tmp_dir = compose.mkdtemp(prefix="pungi_")
|
||||||
try:
|
try:
|
||||||
get_dir_from_scm(product_id, tmp_dir)
|
get_dir_from_scm(product_id, tmp_dir, compose=compose)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno == errno.ENOENT and product_id_allow_missing:
|
if e.errno == errno.ENOENT and product_id_allow_missing:
|
||||||
compose.log_warning("No product IDs in %s" % product_id)
|
compose.log_warning("No product IDs in %s" % product_id)
|
||||||
|
@ -141,7 +141,13 @@ class TestCreaterepoPhase(PungiTestCase):
|
|||||||
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
get_dir_from_scm.call_args_list,
|
get_dir_from_scm.call_args_list,
|
||||||
[mock.call(scm, os.path.join(compose.topdir, "work/global/tmp-Server"))],
|
[
|
||||||
|
mock.call(
|
||||||
|
scm,
|
||||||
|
os.path.join(compose.topdir, "work/global/tmp-Server"),
|
||||||
|
compose=compose,
|
||||||
|
)
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -1333,7 +1339,7 @@ class TestCreateVariantRepo(PungiTestCase):
|
|||||||
|
|
||||||
class TestGetProductIds(PungiTestCase):
|
class TestGetProductIds(PungiTestCase):
|
||||||
def mock_get(self, filenames):
|
def mock_get(self, filenames):
|
||||||
def _mock_get(scm, dest):
|
def _mock_get(scm, dest, compose=None):
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
touch(os.path.join(dest, filename))
|
touch(os.path.join(dest, filename))
|
||||||
|
|
||||||
@ -1379,7 +1385,10 @@ class TestGetProductIds(PungiTestCase):
|
|||||||
|
|
||||||
get_productids_from_scm(self.compose)
|
get_productids_from_scm(self.compose)
|
||||||
|
|
||||||
self.assertEqual(get_dir_from_scm.call_args_list, [mock.call(cfg, mock.ANY)])
|
self.assertEqual(
|
||||||
|
get_dir_from_scm.call_args_list,
|
||||||
|
[mock.call(cfg, mock.ANY, compose=self.compose)],
|
||||||
|
)
|
||||||
self.assertProductIds(
|
self.assertProductIds(
|
||||||
{
|
{
|
||||||
"Client": ["amd64"],
|
"Client": ["amd64"],
|
||||||
@ -1400,7 +1409,10 @@ class TestGetProductIds(PungiTestCase):
|
|||||||
|
|
||||||
get_productids_from_scm(self.compose)
|
get_productids_from_scm(self.compose)
|
||||||
|
|
||||||
self.assertEqual(get_dir_from_scm.call_args_list, [mock.call(cfg, mock.ANY)])
|
self.assertEqual(
|
||||||
|
get_dir_from_scm.call_args_list,
|
||||||
|
[mock.call(cfg, mock.ANY, compose=self.compose)],
|
||||||
|
)
|
||||||
self.assertProductIds({"Server": ["amd64", "x86_64"]})
|
self.assertProductIds({"Server": ["amd64", "x86_64"]})
|
||||||
|
|
||||||
@mock.patch("pungi.phases.createrepo.get_dir_from_scm")
|
@mock.patch("pungi.phases.createrepo.get_dir_from_scm")
|
||||||
@ -1414,7 +1426,10 @@ class TestGetProductIds(PungiTestCase):
|
|||||||
with self.assertRaises(RuntimeError) as ctx:
|
with self.assertRaises(RuntimeError) as ctx:
|
||||||
get_productids_from_scm(self.compose)
|
get_productids_from_scm(self.compose)
|
||||||
|
|
||||||
self.assertEqual(get_dir_from_scm.call_args_list, [mock.call(cfg, mock.ANY)])
|
self.assertEqual(
|
||||||
|
get_dir_from_scm.call_args_list,
|
||||||
|
[mock.call(cfg, mock.ANY, compose=self.compose)],
|
||||||
|
)
|
||||||
self.assertRegex(
|
self.assertRegex(
|
||||||
str(ctx.exception),
|
str(ctx.exception),
|
||||||
r"No product certificate found \(arch: amd64, variant: (Everything|Client)\)", # noqa: E501
|
r"No product certificate found \(arch: amd64, variant: (Everything|Client)\)", # noqa: E501
|
||||||
@ -1438,5 +1453,8 @@ class TestGetProductIds(PungiTestCase):
|
|||||||
with self.assertRaises(RuntimeError) as ctx:
|
with self.assertRaises(RuntimeError) as ctx:
|
||||||
get_productids_from_scm(self.compose)
|
get_productids_from_scm(self.compose)
|
||||||
|
|
||||||
self.assertEqual(get_dir_from_scm.call_args_list, [mock.call(cfg, mock.ANY)])
|
self.assertEqual(
|
||||||
|
get_dir_from_scm.call_args_list,
|
||||||
|
[mock.call(cfg, mock.ANY, compose=self.compose)],
|
||||||
|
)
|
||||||
self.assertRegex(str(ctx.exception), "Multiple product certificates found.+")
|
self.assertRegex(str(ctx.exception), "Multiple product certificates found.+")
|
||||||
|
Loading…
Reference in New Issue
Block a user