mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-03 21:23:44 +08:00
Until now, it was assumed that the module-build command returned only one build, so it was only one build_id. However, it is possible that the module-build command will build more than one builds and therefore a list of build_ids is needed. Also is needed to watch and cancel more than one build. For this reason run, watch, and cancel methods are methods of the PackagingUtility class instead of Build class. Run method returns list of Build objects instead of build_id. And it's also possible to cancel and to watch on all generated module builds.
33 lines
1.0 KiB
Python
33 lines
1.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
def test_failed_build(pkg_util, scenario, repo, koji):
|
|
"""
|
|
Run the build with "rebuild_strategy=all".
|
|
|
|
Check that:
|
|
* Check that the module build eventually fails
|
|
* Check that any other components in the same batch as the failed component are
|
|
cancelled, if not completed.
|
|
"""
|
|
repo.bump()
|
|
builds = pkg_util.run(
|
|
"--optional",
|
|
"rebuild_strategy=all",
|
|
reuse=scenario.get("build_id"),
|
|
)
|
|
assert len(builds) == 1
|
|
build = builds[0]
|
|
pkg_util.watch(builds)
|
|
|
|
assert build.state_name == "failed"
|
|
batch = scenario["batch"]
|
|
failing_components = scenario["failing_components"]
|
|
canceled_components = scenario["canceled_components"]
|
|
assert sorted(failing_components) == sorted(build.component_names(state="FAILED", batch=batch))
|
|
assert sorted(canceled_components) == sorted(
|
|
build.component_names(state="COMPLETE", batch=batch)
|
|
+ build.component_names(state="CANCELED", batch=batch)
|
|
)
|