freezing-fall-2672
09/05/2023, 11:58 AMrefined-addition-53644
09/05/2023, 11:59 AMfreezing-fall-2672
09/05/2023, 12:03 PMfreezing-fall-2672
09/05/2023, 12:04 PMearly-umbrella-56089
09/05/2023, 12:34 PMshell_command
which run docker compose or docker run as dependency of test targetfreezing-fall-2672
09/05/2023, 12:52 PMdry-architect-80370
09/05/2023, 6:33 PMenough-analyst-54434
09/05/2023, 6:45 PMdry-architect-80370
09/05/2023, 6:58 PMenough-analyst-54434
09/05/2023, 7:05 PMenough-analyst-54434
09/05/2023, 7:06 PMdry-architect-80370
09/05/2023, 7:36 PMbroad-processor-92400
09/06/2023, 1:05 AMNot sure if it’s the best approach, but I’m runningAs a warning, unfortunately this isn't a perfect approach:which run docker compose or docker run as dependency of test targetshell_command
shell_command
is designed for producing files on disk, and is cacheable. If the input dependencies are the same as a previous run, the command will not run again, and the output files will just be copied from Pants' cache.
This means that if the docker containers stop running, Pants probably won't restart them because it won't rerun the command.
For us, we just start the containers outside pants, and have tests fail if they're not already started (not great, but it's been acceptable so far).
https://github.com/pantsbuild/pants/issues/16362 is a feature request covering this sort of thing.fresh-cat-90827
09/08/2023, 9:29 PM