You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pytest_container can be used to test containers that run a persistent service, but it is rather inconvenient to test one-shot-style containers which only exist to run their CMD/ENTRYPOINT. For such a container image, you generally just want to invoke it as podman run --rm -it $img $params and act on the output/side effects.
At the moment, pytest_container provides no convenient way how to achieve this. One potential possible way is to use testinfra directly:
SOME_CTR=Container( ... )
deftest_some_ctr(host, container_runtime):
out=host.check_output(f"{container_runtime.runner_binary} run --rm -it {SOME_CTR.url}")
# do smth with out
However, that quickly breaks down, when SOME_CTR is no longer a Container but a DerivedContainer as then we need to build the container beforehand. Executing this manually is laborious and inconvenient. It would be great to provide a helper or a new fixture here.
The text was updated successfully, but these errors were encountered:
pytest_container
can be used to test containers that run a persistent service, but it is rather inconvenient to test one-shot-style containers which only exist to run their CMD/ENTRYPOINT. For such a container image, you generally just want to invoke it aspodman run --rm -it $img $params
and act on the output/side effects.At the moment,
pytest_container
provides no convenient way how to achieve this. One potential possible way is to use testinfra directly:However, that quickly breaks down, when
SOME_CTR
is no longer aContainer
but aDerivedContainer
as then we need to build the container beforehand. Executing this manually is laborious and inconvenient. It would be great to provide a helper or a new fixture here.The text was updated successfully, but these errors were encountered: