mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-09 21:59:58 +08:00
Until now, to access the configuration of a scenario, the full path in
test_env had to be specified.
This might be cumbersome and error prone.
Create a scenario fixture, to make it easier to access the same
configuration.
Instead of
test_env["testdata"]["my_scenario"]["my_config"]
one can use the following:
scenario["my_config"]
Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
37 lines
1.0 KiB
Python
37 lines
1.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
import utils
|
|
|
|
|
|
def test_reuse_all_components(test_env, 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.
|
|
"""
|
|
build = utils.Build(test_env["packaging_utility"], test_env["mbs_api"])
|
|
repo.bump()
|
|
build.run(
|
|
"--watch",
|
|
"--optional",
|
|
"rebuild_strategy=all",
|
|
reuse=scenario.get("build_id"),
|
|
)
|
|
task_ids = build.component_task_ids()
|
|
task_ids.pop("module-build-macros")
|
|
|
|
repo.bump()
|
|
build.run(
|
|
"-w",
|
|
"--optional",
|
|
"rebuild_strategy=only-changed",
|
|
reuse=scenario.get("build_id_reused"))
|
|
reused_task_ids = build.component_task_ids()
|
|
|
|
assert not build.components(package="module-build-macros")
|
|
assert task_ids == reused_task_ids
|