I've successfully migrated 2 repos to a pants mono...
# general
f
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
The syntax for passthrough arguments is like this:
./pants test.pytest path/to:target -- -n 10
f
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
you can override the pytest requirement! i believe
./pants options | grep pytest
shows the right option to change
f
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
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
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
@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
got it!