Use asyncio for subprocess calls

Removes the threads from compose_up and manages it using async. Also
uses async processing to format the log messages instead of piping
through sed. This should work on windows without having sed installed

Adds --parallel to support pull and build in parallel, same as docker
compose

Signed-off-by: Falmarri <463948+Falmarri@users.noreply.github.com>
This commit is contained in:
Falmarri
2023-12-09 22:51:54 -08:00
committed by Muayyad Alsadi
parent bce40c2db3
commit 38b13a34ea
2 changed files with 195 additions and 165 deletions

View File

@ -33,6 +33,8 @@ def test_podman_compose_extends_w_file_subdir():
"podman",
"container",
"ps",
"--sort",
"status",
"--all",
"--format",
'"{{.Image}}"',
@ -51,14 +53,16 @@ def test_podman_compose_extends_w_file_subdir():
# check container was created and exists
out, _, returncode = capture(command_check_container)
assert 0 == returncode
assert out == b'"localhost/subdir_test:me"\n'
assert b'"localhost/subdir_test:me"\n' in out
out, _, returncode = capture(command_down)
# cleanup test image(tags)
assert 0 == returncode
print('ok')
# check container did not exists anymore
out, _, returncode = capture(command_check_container)
print(out)
assert 0 == returncode
assert out == b""
assert b'"localhost/subdir_test:me"\n' not in out
def test_podman_compose_extends_w_empty_service():