Files
fm-orchestrator/tests/integration/test_failed_build.py
Mariana Ulaieva a5f6d8f136 Factor out packaging utility
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.
2020-01-23 14:26:46 +01:00

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)
)