webknossos-libs
webknossos-libs copied to clipboard
speed up tests
CLI integration tests
Some of the CLI test scripts take quite long and should be sped up (by using a smaller test case, or by improving the routines if possible):
-
compression_and_verification.sh
1m38s -
upsampling.sh
1m27s -
downsampling.sh
20s -
anisotropic_downsampling.sh
18s -
in_place_compression.sh
13s
unit tests
No unit test should take longer than 5s without very good reasons. I collected the slowest tests in wkcuber and webknossos using poetry run pytest --durations=0
wkcuber
34.52s call tests/test_downsampling.py::test_compressed_downsample_cube_job
23.50s call tests/test_downsampling.py::test_downsample_cube_job
6.57s call tests/test_upsampling.py::test_compressed_upsample_cube_job
5.10s call tests/test_upsampling.py::test_upsample_cube_job
4.43s call tests/test_downsampling.py::test_downsample_mag_list
webknossos
6.84s call tests/test_dataset.py::test_chunking_wk_advanced
3.30s call tests/test_dataset.py::test_chunking_wk_wrong_chunk_size
related: #580
Besides reducing the test times per test, we might want to use pytest-xdist
to parallelize the tests. This needs some work on using tmppath
everywhere instead of the testoutput
directory, to avoid conflicting parallel tests.