diff --git a/tests/integration/test_failed_build.py b/tests/integration/test_failed_build.py index eb63c4b5..9ef644c8 100644 --- a/tests/integration/test_failed_build.py +++ b/tests/integration/test_failed_build.py @@ -16,12 +16,11 @@ def test_failed_build(test_env, repo, koji): build = utils.Build(test_env["packaging_utility"], test_env["mbs_api"]) repo.bump() build.run( - "--watch", - "--scratch", "--optional", "rebuild_strategy=all", reuse=test_env["testdata"]["failed_build"].get("build_id"), ) + build.watch() assert build.state_name == "failed" batch = test_env["testdata"]["failed_build"]["batch"] diff --git a/tests/integration/test_normal_build.py b/tests/integration/test_normal_build.py index a414b015..0dece3e2 100644 --- a/tests/integration/test_normal_build.py +++ b/tests/integration/test_normal_build.py @@ -20,12 +20,12 @@ def test_normal_build(test_env, repo, koji): build = utils.Build(test_env["packaging_utility"], test_env["mbs_api"]) repo.bump() build_id = build.run( - "--watch", - "--scratch", "--optional", "rebuild_strategy=all", reuse=test_env["testdata"]["normal_build"].get("build_id"), ) + build.watch() + assert sorted(build.component_names()) == sorted(repo.components + ["module-build-macros"]) expected_buildorder = test_env["testdata"]["normal_build"]["buildorder"] diff --git a/tests/integration/test_scratch_build.py b/tests/integration/test_scratch_build.py index 0636a85e..f7182f61 100644 --- a/tests/integration/test_scratch_build.py +++ b/tests/integration/test_scratch_build.py @@ -16,12 +16,12 @@ def test_scratch_build(test_env, repo, koji): """ build = utils.Build(test_env["packaging_utility"], test_env["mbs_api"]) build.run( - "--watch", "--scratch", "--optional", "rebuild_strategy=all", reuse=test_env["testdata"]["scratch_build"].get("build_id"), ) + build.watch() assert build.state_name == "done" assert sorted(build.component_names(state="COMPLETE")) == sorted( diff --git a/tests/integration/utils.py b/tests/integration/utils.py index de0840e2..5f76572d 100644 --- a/tests/integration/utils.py +++ b/tests/integration/utils.py @@ -154,6 +154,17 @@ class Build: self._build_id = int(re.search(self._mbs_api + r"module-builds/(\d+)", stdout).group(1)) return self._build_id + def watch(self): + """Watch the build till the finish""" + if self._build_id is None: + raise RuntimeError("Build was not started. Cannot watch.") + + stdout = self._packaging_utility( + "module-build-watch", str(self._build_id) + ).stdout.decode("utf-8") + + return stdout + def cancel(self): """Cancel the module build