I’m running `./pants test ::` and I want to sort t...
# development
I’m running
./pants test ::
and I want to sort the tests by durations, with pytest I would do something like
Is there something similar with pants that allows me also to sort by slowest to fastest test?
I’m not aware of any such sorting between test targets (such as
) but for a single target, you may pass your pytest args either in the configuration or on the command line:
./pants test :: — --durations=0
See https://www.pantsbuild.org/docs/python-test-goal#passing-arguments-to-pytest for more info 🙂
If you want to see the pytest output as it runs, this is likely interesting read as well: https://www.pantsbuild.org/docs/python-test-goal#running-tests-interactively
It’s not what I’m asking. I’m asking whether pants saved the runtime of actions and can output the runtime of tests
But it seems the answer is no, It makes it hard to flag bad tests
Oh, right. There’s the junit output that you can capture. Not sure if runtimes are recorded in that, though. https://www.pantsbuild.org/docs/python-test-goal#junit-xml-results
I’m obviously not familiar with what
does for pytest…
Junit might be what I’m looking for, thanks!
💯 1
Pants does store them, as well as their cache status: see the last comment on https://github.com/pantsbuild/pants/issues/13588 … they’re just not rendered yet.
i’d be really happy to mentor someone through finishing https://github.com/pantsbuild/pants/issues/13588, as i expect that it will be a fairly easy but really high value change!
👀 1
@witty-crayon-22786 maybe cross-post to #general as well since there's potential for this to be a first issue for someone not yet hanging out in #development.
I could help with this @witty-crayon-22786
🎉 1
ah, shoot! sorry i missed this. are you
on github? responded to a question there
yep - no worries - that’s me 🙂
👍 1
Looking at the test duration output. Any thoughts on suggested console output / layout? Notes here - https://github.com/pantsbuild/pants/issues/13588#issuecomment-991863653
👀 1
👍 1
looks great! can further tweak alignment in the future