mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-13 01:54:59 +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.
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
def test_reuse_all_components(pkg_util, scenario, repo, koji):
|
|
"""Rebuild the test module again, without changing any of the components with:
|
|
|
|
`fedpkg module-build -w --optional rebuild_strategy=only-changed`
|
|
|
|
Checks:
|
|
* Verify that all the components are reused from the first build.
|
|
* Verify that module-build-macros is not built in the second build.
|
|
"""
|
|
repo.bump()
|
|
builds = pkg_util.run(
|
|
"--watch",
|
|
"--optional",
|
|
"rebuild_strategy=all",
|
|
reuse=scenario.get("build_id"),
|
|
)
|
|
assert len(builds) == 1
|
|
|
|
build = builds[0]
|
|
task_ids = build.component_task_ids()
|
|
task_ids.pop("module-build-macros")
|
|
|
|
repo.bump()
|
|
builds = pkg_util.run(
|
|
"-w",
|
|
"--optional",
|
|
"rebuild_strategy=only-changed",
|
|
reuse=scenario.get("build_id_reused"))
|
|
|
|
assert len(builds) == 1
|
|
build = builds[0]
|
|
reused_task_ids = build.component_task_ids()
|
|
|
|
assert not build.components(package="module-build-macros")
|
|
assert task_ids == reused_task_ids
|