Hello all.I have a question regarding `python_test...
# general
l
Hello all.I have a question regarding
python_test(s)
. The docs state that
runtime_package_dependencies
puts the packaged resources into chroot. If the
runtime_package_dependencies
is a
docker_image
, is there a way to get the image name/tag that was created?
b
I dont' think so šŸ¤” It should build the image before executing the tests, but I'm not sure if there's a way to deduce the image name/tag or anything in the sandbox
@curved-television-6568 I've mused about all packagables putting something in the sandbox (another way of saying that every Packageable needs an
output_path
field). If I'm not thinking too crazily this would allow us to dump a file either named after the image tag, or containing the image tag.
šŸ‘€ 1
l
Yeah it does get built as expected. Iā€™m currently just forcing
latest
and hard coding the name/tag as en environment variable Yeah it does get built as expected. Iā€™m currently using
b
Very interesting use case šŸ™‚ Love it
šŸ˜ 2
l
Yeah that sounds like a good solution šŸ™‚ It would be interesting to be able to directly reference output properties of a target either directly or with a helper or interpolation - not sure how that fits in with the general pants world though. Something like:
Copy code
extra_env_vars = [
    # Helper func 
    "IMAGE_NAME=" + output(":docker", "sha"),
    #or interpolation
    "IMAGE_NAME={:docker.sha}"
]
h
@lively-king-98806 could you open a ticket at https://github.com/pantsbuild/pants/issues with as much detail as you think is useful? Thanks!
āœ… 1