https://pantsbuild.org/ logo
#general
Title
# general
f

faint-holiday-82821

04/11/2019, 10:30 PM
I've successfully migrated 2 repos to a pants monorepo. Tests all run! Now I want to make them fast and parallelized, like using pytest-xdist[1] to run them all in parallel. Whats the best way to get ./pants test to be able to use their pytest extension? Passing in
options="-n 10"
errors out w/ unrecognized arguments: -n [1] https://pypi.org/project/pytest-xdist/
❤️ 1
h

hundreds-father-404

04/11/2019, 10:37 PM
The syntax for passthrough arguments is like this:
./pants test.pytest path/to:target -- -n 10
f

faint-holiday-82821

04/11/2019, 10:38 PM
Yup tried that - i think the issue is the pants pytest cant discover the
pytest-xdist
package i
pip installed
Copy code
17e844bf4b2467d94ea00b9e8177656ab1a1cfcf: error: unrecognized arguments: -n
a

aloof-angle-91616

04/11/2019, 10:41 PM
you can override the pytest requirement! i believe
./pants options | grep pytest
shows the right option to change
f

faint-holiday-82821

04/11/2019, 10:43 PM
Thats helpful for validating that my option is present in the .ini file, but doesn't fix what I think is a virtualenv problem
(but also that just helped me debug something, didn't know about ./pants options, nice.)
a

aloof-angle-91616

04/11/2019, 10:44 PM
pants doesn't require you to mess around with virtualenv, i believe if you run pytest you will be running the pytest specified by that option
f

faint-holiday-82821

04/11/2019, 10:48 PM
Some progress! I added in the
pytest-xdist
as a dependency in a target all my tests depend on, now its giving me a plugin could not be loaded error 🙂
ah no dice 😞
a

aloof-angle-91616

04/12/2019, 1:30 AM
@faint-holiday-82821 if you could please make an issue at https://github.com/pantsbuild/pants/issues/new, we can probably advise you better as the answer isn’t immediately clear in this case — feel free to just copy/paste this slack convo as an issue and give it a descriptive title
f

faint-holiday-82821

04/12/2019, 5:17 PM
got it!