Is there some way I can use depend on a target tha...
# general
e
Is there some way I can use depend on a target that I can
pants run
? For example, my repo contains an api server (packaged into a docker container), and an api client with tests. Usually, my workflow is:
Copy code
pants package ::
docker compose up  # docker compose expects the api server image name/tags that are used by pants, but is otherwise pantsless
pants test :: the test fixtures initialize the api client with values that assume the server is running at localhost:<port> so that it can find the running docker container
I am curious if there is a way (either by moving the docker compose info into the pants docker targets themselves, or some other way), to get pants to understand, "the api server tests depend on XYZ docker images, so I should make sure they are running and then run those tests" and reduce the above to a single
pants test
command
a
You can probably use the adhoc_tool target. It's essentially "something that needs to run for it's side effect", and if you depend on it, it will be ran first. Make sure you use good settings for your
cache_scope
cause depending on that, the script might not be executed everytime if it considers it's result "cached".
👀 1