Closed asmacdo closed 2 months ago
it is worthwhile, meanwhile can use pytest-xdist and parallelize to e.g. 5 to gain some speedup. E.g.
❯ time python -m pytest test
================================== test session starts ==================================
platform linux -- Python 3.12.4, pytest-8.2.0, pluggy-1.5.0
rootdir: /home/yoh/proj/CON/duct
configfile: tox.ini
plugins: mock-3.14.0, cov-5.0.0, xdist-3.6.1
collected 68 items
test/test_execution.py ............ [ 17%]
test/test_log_paths.py .............. [ 38%]
test/test_prepare_outputs.py ................ [ 61%]
test/test_report.py ........ [ 73%]
test/test_tailpipe.py ............... [ 95%]
test/test_validation.py ... [100%]
---------- coverage: platform linux, python 3.12.4-final-0 -----------
Name Stmts Miss Branch BrPart Cover Missing
-----------------------------------------------------------------------
src/con_duct/__init__.py 1 0 0 0 100.00%
src/con_duct/__main__.py 344 17 104 7 94.20% 51, 66, 279->exit, 297-298, 315->314, 339-340, 545, 581-582, 599-600, 654-655, 689-690, 714, 718->722, 727->735, 743
-----------------------------------------------------------------------
TOTAL 345 17 104 7 94.21%
================================== 68 passed in 15.71s ==================================
python -m pytest test 14.55s user 5.83s system 125% cpu 16.258 total
❯ time python -m pytest -n 5 test
================================== test session starts ==================================
platform linux -- Python 3.12.4, pytest-8.2.0, pluggy-1.5.0
rootdir: /home/yoh/proj/CON/duct
configfile: tox.ini
plugins: mock-3.14.0, cov-5.0.0, xdist-3.6.1
5 workers [68 items]
.................................................................... [100%]
---------- coverage: platform linux, python 3.12.4-final-0 -----------
Name Stmts Miss Branch BrPart Cover Missing
-----------------------------------------------------------------------
src/con_duct/__init__.py 1 0 0 0 100.00%
src/con_duct/__main__.py 344 17 104 7 94.20% 51, 66, 279->exit, 297-298, 315->314, 339-340, 545, 581-582, 599-600, 654-655, 689-690, 714, 718->722, 727->735, 743
-----------------------------------------------------------------------
TOTAL 345 17 104 7 94.21%
================================== 68 passed in 9.34s ===================================
python -m pytest -n 5 test 24.21s user 6.65s system 310% cpu 9.936 total
so still 9 seconds but faster than original 15.
I doubt it is worth spending time on ATM -- they are speedy enough for now, and some recent changes might help to reduce it further.
They aren't miserably slow, but we can tweak (and standardize) the time values in the test_execution args and probably make this blazing fast. Doesn't seem crucial to block release though.