Is there a way to only build .pex files before run...
# general
r
Is there a way to only build .pex files before running tests? I have a series of tests that I have to run sequentially (because they use a database) so I'm passing in
--process-execution-local-parallelism=1
. The tests themselves don't take that long to run. However, doing things sequentially also affects the step of building all the .pex files, which takes forever. My plan, for now, is the following: 1. Run
pants test :: -- --setup-plan
. This should build all the .pex files concurrently~, but will ultimately fail when the tests are run.~ 2. Run
pants --process-execution-local-parallelism=1 test ::
. This should run without having to rebuild any of the .pex files. Just wondering if there's any better workarounds.
w
This exact topic has come up a lot (a lot, a lot) and this workflow has come up pretty recently in slack. For the life of me, I can’t recall the conclusion, but if you search for that flag and see what has come up in the past 6 months - maybe there are some better answers? Overall, the idea/question was parallel builds, sequential tests
b
Solving the problem in potentially a different way, there’s ways to adapt to the concurrency too, eg https://pantsbuild.slack.com/archives/C046T6T9U/p1715665974559899 That’ll likely require some code changes of course
w
This is definitively one of those topics that we need a full dedicated page for in the docs. It comes up regularly, and there are multiple solutions depending on each desired implementation
r
Hmm, was hoping for a quicker solution but so far the solution that keeps being mentioned involves using execution slot vars. I'm not going to go for that (now) since I was hoping for no code changes. Might circle back later if I have the time. Pytest does have a
--setup-plan
cmdline arg which seems to pretty much nullify test running which is ideal for the first step of just building pex files.