mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-03 13:13:27 +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.
34 lines
953 B
Python
34 lines
953 B
Python
# -*- coding: utf-8 -*-
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
def test_scratch_build(pkg_util, scenario, repo, koji):
|
|
"""
|
|
Run a scratch build with "rebuild_strategy=all".
|
|
|
|
Check that:
|
|
* the module build is done with the correct components
|
|
* the module build completes in the "done" state
|
|
(as opposed to the "ready" state)
|
|
* no content generator builds are created in Koji
|
|
"""
|
|
builds = pkg_util.run(
|
|
"--scratch",
|
|
"--optional",
|
|
"rebuild_strategy=all",
|
|
reuse=scenario.get("build_id"),
|
|
)
|
|
|
|
assert len(builds) == 1
|
|
pkg_util.watch(builds)
|
|
build = builds[0]
|
|
|
|
assert build.state_name == "done"
|
|
assert sorted(build.component_names(state="COMPLETE")) == sorted(
|
|
repo.components + ["module-build-macros"]
|
|
)
|
|
|
|
cg_build = koji.get_build(build.nvr())
|
|
cg_devel_build = koji.get_build(build.nvr(name_suffix="-devel"))
|
|
assert not (cg_build or cg_devel_build)
|