]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
ci: Implement 'test' helper action
authorAndrea Bolognani <abologna@redhat.com>
Fri, 12 Mar 2021 17:01:43 +0000 (18:01 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 15 Mar 2021 17:49:03 +0000 (18:49 +0100)
This simply calls the underlying Makefile target, but allows
additional arguments to be specified in a more convenient and
discoverable way.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
ci/helper

index 57ebe1f8409496ad55e93e1ca2c83935d17c86b8..73a3f729da126d52828da9b4194ff58b352e2f88 100755 (executable)
--- a/ci/helper
+++ b/ci/helper
@@ -82,6 +82,14 @@ class Parser:
         )
         buildparser.set_defaults(func=Application.action_build)
 
+        # test action
+        testparser = subparsers.add_parser(
+            "test",
+            help="run a build in a container (including tests)",
+            parents=[containerparser, mesonparser],
+        )
+        testparser.set_defaults(func=Application.action_test)
+
         # shell action
         shellparser = subparsers.add_parser(
             "shell",
@@ -125,7 +133,7 @@ class Application:
             target,
         ]
 
-        if self.args.action in ["build", "shell"]:
+        if self.args.action in ["build", "test", "shell"]:
             args.extend([
                 f"CI_ENGINE={self.args.engine}",
                 f"CI_USER_LOGIN={self.args.login}",
@@ -133,7 +141,7 @@ class Application:
                 f"CI_IMAGE_TAG={self.args.image_tag}",
             ])
 
-        if self.args.action == "build":
+        if self.args.action in ["build", "test"]:
             args.extend([
                 f"CI_MESON_ARGS={self.args.meson_args}",
                 f"CI_NINJA_ARGS={self.args.ninja_args}",
@@ -221,6 +229,9 @@ class Application:
     def action_build(self):
         self.make_run(f"ci-build@{self.args.target}")
 
+    def action_test(self):
+        self.make_run(f"ci-test@{self.args.target}")
+
     def action_shell(self):
         self.make_run(f"ci-shell@{self.args.target}")