Files
fm-orchestrator/tests/integration/test_scratch_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

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)