-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
main,osbuildprogress: add
--progress=term,plain,debug
support
This adds a new `progress` flag that makes use of the osbuild jsonseq progress information to show progress and hide the low-level details from the user.
- Loading branch information
Showing
3 changed files
with
73 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import subprocess | ||
|
||
# pylint: disable=unused-import | ||
from test_opts import container_storage_fixture | ||
from containerbuild import build_container_fixture, build_fake_container_fixture | ||
|
||
|
||
def bib_cmd(container_storage, output_path, build_fake_container): | ||
return [ | ||
"podman", "run", "--rm", | ||
"--privileged", | ||
"--security-opt", "label=type:unconfined_t", | ||
"-v", f"{container_storage}:/var/lib/containers/storage", | ||
"-v", f"{output_path}:/output", | ||
build_fake_container, | ||
"build", | ||
"quay.io/centos-bootc/centos-bootc:stream9", | ||
] | ||
|
||
|
||
def test_progress_debug(tmp_path, container_storage, build_fake_container): | ||
output_path = tmp_path / "output" | ||
output_path.mkdir(exist_ok=True) | ||
|
||
cmdline = bib_cmd(container_storage, output_path, build_fake_container) | ||
cmdline.append("--progress=debug") | ||
res = subprocess.run(cmdline, capture_output=True, check=True, text=True) | ||
assert res.stderr.count("Start progressbar") == 1 | ||
assert res.stderr.count("Manifest generation step") == 1 | ||
assert res.stderr.count("Image generation step") == 1 | ||
assert res.stderr.count("Build complete") == 1 | ||
assert res.stderr.count("Stop progressbar") == 1 | ||
assert res.stdout.strip() == "" |