Hello :wave:! I have starting to scratch pants sur...
# general
Hello 👋! I have starting to scratch pants surface and seems very interesting 😉 . I have a bunch of python repos, every repo goal is to build a docker container with contents depending on files on the repo. I have successfully built docker images using
instructions and I can run them using
run container
command. Now, I want to add some integration tests which only pass if container is running to attend requests generated in python_test sections. How I can start a
before running
? Thx!
I’m trying to do something similar and currently using this https://www.pantsbuild.org/docs/environments
oh wait, I think I misunderstood, in the case you want containers up before running the tests, for that all I have is a docker-compose.yml that I fire up before running the tests
yes, I want containers up before running the tests. How I can fire up a docker-compose file with pants?
I’m not using pants for that 😞
I reference the images built with pants in my docker-compose.yml and then run a regular
docker compose
ok, thanks. Maybe a
running docker-compose could work?
there’s currently not much support for setup/teardown around running tests with pants. You can use
for setup, but it will leave it running also after the tests etc..
ok, thanks
Using shell_command may be a bit unreliable: it is cacheable, and just focused on file outputs (that is, best for “pure” code generation and similar): if the inputs are the same, pants won’t rerun it, because it will just pull the resulting files from its cache. This is a problem if the containers have stopped: pants won’t know and won’t restart. https://github.com/pantsbuild/pants/issues/16362 is a feature request issue.
👍 1