rough-electrician-21871
07/28/2022, 8:32 AMdocker-compose file, where required, and run docker-compose up prior to executing pytest, for example. So the layout of monorepo looks roughly like this:
└── services
├── go-service-1
│ └── <CODEBASE>
│ └── docker-compose.yaml
├── py-service-1
│ └── <CODEBASE>
│ └── docker-compose.yaml
└── py-service-2
│ └── <CODEBASE>
└── docker-compose.yaml
But I don’t see a clear way for pants to understand that it need to execute docker-compose up in a directory path/to/service/foo upon a code-change of that service foo
And the use-case is quite common, so perhaps it’s solved somehow differently? Maybe I need to employ experimental_shell_command to spin up DBs and set some envs for unit tests to consume?
Basically, that’s the only stopping factor of us starting to adopt pants — i simply don’t understand how to solve my issue at hand..happy-kitchen-89482
07/28/2022, 4:41 PMexperimental_shell_command (although that doesn't give you teardown at the end). Another is to lean on conftest.py, but because that runs for every test file (Pants invokes pytest on each test file separately, for better concurrency and caching) that may not work for setting up global state without a lot of complication.happy-kitchen-89482
07/28/2022, 4:41 PMwitty-crayon-22786
07/28/2022, 4:50 PMrough-electrician-21871
07/29/2022, 8:42 AMAnother is to lean onbut it doesn’t resolve the case for non-python codebases, and the solution begs to be language-agnostic, I’d say Do you thinkconftest.py
pants should handle it or rather rely on some tooling instead?rough-electrician-21871
07/29/2022, 8:45 AMpre-hook and post-hook thing. This would allow to cover many use cases with a relatively generalised approach, I gatherhappy-kitchen-89482
07/29/2022, 11:19 PMrough-electrician-21871
08/01/2022, 1:40 PM