Files
fm-orchestrator/tests/integration/test_resume_cancelled_build.py
Hunor Csomortáni 5f7442f8c1 Tests: Create a fixture for scenario configuration
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>
2020-01-16 10:29:14 +01:00

34 lines
951 B
Python

# -*- coding: utf-8 -*-
# SPDX-License-Identifier: MIT
import utils
import time
def test_resume_cancelled_build(test_env, scenario, repo, koji):
"""
Run the build with "rebuild_strategy=all".
Wait until the module-build-macros build is submitted to Koji.
Cancel module build.
Resume the module with "rhpkg-stage module-build -w".
Check that:
* Check that the testmodule had actually been cancelled
* Check that the testmodule build succeeded
"""
build = utils.Build(test_env["packaging_utility"], test_env["mbs_api"])
repo.bump()
build.run(
"--optional",
"rebuild_strategy=all",
)
build.wait_for_koji_task_id(package="module-build-macros", batch=1)
build.cancel()
# Behave like a human: restarting the build too quickly would lead to an error.
time.sleep(10)
build.run("--watch")
assert build.state_name == "ready"
assert build.was_cancelled()