#308 Add module defaults to module compose
Merged 4 years ago by lsedlar. Opened 4 years ago by lsedlar.

@@ -164,6 +164,7 @@ 

              self.koji_tag = None

              self.gather_source = "module"

              self.gather_method = "nodeps"

+             self.module_defaults_url = module_defaults_url.split(" ") if module_defaults_url else []

  

              self._sort_out_devel_modules()

  

file modified
+17 -3
@@ -55,14 +55,28 @@ 

          return conf

  

      def test_pungi_config_module(self):

-         pungi_cfg = PungiConfig("MBS-512", "1", PungiSourceType.MODULE,

-                                 "testmodule:master:1:1")

-         pungi_cfg.get_pungi_config()

+         pungi_cfg = PungiConfig(

+             "MBS-512",

+             "1",

+             PungiSourceType.MODULE,

+             "testmodule:master:1:1",

+             module_defaults_url="git://localhost.tld/x.git master",

+         )

+         cfg = pungi_cfg.get_pungi_config()

          variants = pungi_cfg.get_variants_config()

          comps = pungi_cfg.get_comps_config()

  

          self.assertTrue(variants.find("<module>") != -1)

          self.assertEqual(comps, "")

+         self.assertEqual(

+             self._load_pungi_cfg(cfg)["module_defaults_dir"],

+             {

+                 "branch": "master",

+                 "dir": ".",

+                 "repo": "git://localhost.tld/x.git",

+                 "scm": "git",

+             },

+         )

  

      def test_pungi_config_tag(self):

          pungi_cfg = PungiConfig("MBS-512", "1", PungiSourceType.KOJI_TAG,

If the defaults are provided in the compose, this should propagate them into Pungi config to be included in the compose.

+1, you could write/extend test for that in server/tests/test_pungi:test_pungi_config_module.

rebased onto d364b7e

4 years ago

Pull-Request has been merged by lsedlar

4 years ago