mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-05 11:48:33 +08:00
Integration tests: enable parameters for clone_and_start_build fixture.
This commit is contained in:
@@ -96,10 +96,23 @@ def clone_and_start_build(repo, pkg_util):
|
||||
:rtype utils.Repo, list:
|
||||
"""
|
||||
repo.bump()
|
||||
builds = pkg_util.run("--optional", "rebuild_strategy=all")
|
||||
yield repo, builds
|
||||
for build in builds:
|
||||
pkg_util.cancel(build, ignore_errors=True)
|
||||
_builds = []
|
||||
_cancel = True
|
||||
|
||||
def _build(*args, cancel=True, **kwargs):
|
||||
nonlocal _builds, _cancel
|
||||
options = [str(i) for i in args]
|
||||
builds = pkg_util.run(*options, **kwargs)
|
||||
if not builds:
|
||||
raise AssertionError(f"Packaging utility args={options} did not produce any builds")
|
||||
_builds, _cancel = (builds, cancel)
|
||||
return repo, builds
|
||||
|
||||
yield _build
|
||||
|
||||
if _cancel:
|
||||
for build in _builds:
|
||||
pkg_util.cancel(build, ignore_errors=True)
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
|
||||
@@ -9,7 +9,7 @@ def test_buildonly(clone_and_start_build, mbs):
|
||||
* Assert that the expected filter field was created in the module metadata.
|
||||
"""
|
||||
|
||||
repo, builds = clone_and_start_build
|
||||
repo, builds = clone_and_start_build("--optional", "rebuild_strategy=all")
|
||||
|
||||
# Check the original modulemd
|
||||
modulemd = repo.modulemd
|
||||
|
||||
@@ -8,7 +8,7 @@ def test_rest_module_build(clone_and_start_build, mbs, koji, pkg_util):
|
||||
* There is no need for exhaustive testing of the REST API here,
|
||||
as extensive coverage of it is already implemented in tests/test_web/test_views.py.
|
||||
"""
|
||||
repo, builds = clone_and_start_build
|
||||
repo, builds = clone_and_start_build("--optional", "rebuild_strategy=all")
|
||||
assert len(builds) >= 1
|
||||
|
||||
username = getpass.getuser()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
def test_static_context(clone_and_start_build, mbs):
|
||||
repo, builds = clone_and_start_build
|
||||
repo, builds = clone_and_start_build("--optional", "rebuild_strategy=all")
|
||||
|
||||
static_contexts = repo.modulemd["data"]["xmd"]["mbs_options"]["contexts"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user