You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes it's useful to know how long an individual test took to run on CI.
A recent case involved a sync to an amazon repository on pulp_rpm, which we are considering skipping depending on it's cost (because it's a pretty edgy case). On my machine this particular test took more than the whole CI run, so checking this timing locally was misleading.
Pytest has a builtin option to list those duration after a test session, which I think we could add to our pytest call.
It looks like this:
# --durations=0 list all test durations after each session>pytest--durations=0-v====================================================================testsessionstarts=====================================================================platformlinux--Python3.12.4, pytest-8.3.3, pluggy-1.5.0--/tmp/foo/venv/bin/pythoncachedir: .pytest_cacherootdir: /tmp/fooplugins: xdist-3.6.116workers [4items]
schedulingtestsviaLoadSchedulingtest_foo.py::test_longtest_foo.py::test_bartest_foo.py::test_bar3test_foo.py::test_bar2
[gw1] [ 25%] SKIPPEDtest_foo.py::test_long
[gw0] [ 50%] PASSEDtest_foo.py::test_bar
[gw3] [ 75%] PASSEDtest_foo.py::test_bar3
[gw2] [100%] PASSEDtest_foo.py::test_bar2=====================================================================slowestdurations======================================================================2.00scalltest_foo.py::test_bar21.50scalltest_foo.py::test_bar31.00scalltest_foo.py::test_bar
(8durations<0.005shidden. Use-vvtoshowthesedurations.)
================================================================3passed, 1skippedin3.91s================================================================
I'm open to any objections.
The text was updated successfully, but these errors were encountered:
Sometimes it's useful to know how long an individual test took to run on CI.
A recent case involved a sync to an amazon repository on pulp_rpm, which we are considering skipping depending on it's cost (because it's a pretty edgy case). On my machine this particular test took more than the whole CI run, so checking this timing locally was misleading.
Pytest has a builtin option to list those duration after a test session, which I think we could add to our pytest call.
It looks like this:
I'm open to any objections.
The text was updated successfully, but these errors were encountered: