For the Pants `test` goal to run Python tests (<ht...
# general
For the Pants
goal to run Python tests (, is there an option to do more than one run per test? The context is that I want to do periodic runs in CI where all unit tests are reran forcefully (i.e., with the
option) in order to help catch unit test flakiness. I also would like to do more than one run per test. For comparison, in Bazel one can do
--runs_per_test=<n> --cache_test_results=no
, which fits the ask perfectly. However, Pants doesn't seem to have the option to do more than forceful run per test. I suppose one could do something such as wrap
./pants test --force ::
in a Bash loop (
for i in {1..<n>}; do ./pants test --force ::; done
), but that feels clunky.
There's likely a pytest plugin for that if you're in Python land. We do something similar for rerun on fiakure
It looks like there's a
plugin: However, the project description page rules out support with
test classes outright, which would be a deal breaker.
I suspect that's a limitation of pytest trying not to overstep when running unittest tests 😕
These features wouldn't be too hard to add. Feel free to file an issue. Also, we'd love to shepherd you along if you're interested in contributing!
Let me know how I can help with this feature request and I would be willing to do so.