mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-08 12:41:29 +00:00
ci: Implement 'test' helper action
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>
This commit is contained in:
parent
f0fd72381d
commit
22ed68d0a9
15
ci/helper
15
ci/helper
@ -82,6 +82,14 @@ class Parser:
|
|||||||
)
|
)
|
||||||
buildparser.set_defaults(func=Application.action_build)
|
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
|
# shell action
|
||||||
shellparser = subparsers.add_parser(
|
shellparser = subparsers.add_parser(
|
||||||
"shell",
|
"shell",
|
||||||
@ -125,7 +133,7 @@ class Application:
|
|||||||
target,
|
target,
|
||||||
]
|
]
|
||||||
|
|
||||||
if self.args.action in ["build", "shell"]:
|
if self.args.action in ["build", "test", "shell"]:
|
||||||
args.extend([
|
args.extend([
|
||||||
f"CI_ENGINE={self.args.engine}",
|
f"CI_ENGINE={self.args.engine}",
|
||||||
f"CI_USER_LOGIN={self.args.login}",
|
f"CI_USER_LOGIN={self.args.login}",
|
||||||
@ -133,7 +141,7 @@ class Application:
|
|||||||
f"CI_IMAGE_TAG={self.args.image_tag}",
|
f"CI_IMAGE_TAG={self.args.image_tag}",
|
||||||
])
|
])
|
||||||
|
|
||||||
if self.args.action == "build":
|
if self.args.action in ["build", "test"]:
|
||||||
args.extend([
|
args.extend([
|
||||||
f"CI_MESON_ARGS={self.args.meson_args}",
|
f"CI_MESON_ARGS={self.args.meson_args}",
|
||||||
f"CI_NINJA_ARGS={self.args.ninja_args}",
|
f"CI_NINJA_ARGS={self.args.ninja_args}",
|
||||||
@ -221,6 +229,9 @@ class Application:
|
|||||||
def action_build(self):
|
def action_build(self):
|
||||||
self.make_run(f"ci-build@{self.args.target}")
|
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):
|
def action_shell(self):
|
||||||
self.make_run(f"ci-shell@{self.args.target}")
|
self.make_run(f"ci-shell@{self.args.target}")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user