Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up test execution #268

Open
ecomodeller opened this issue Sep 29, 2023 · 5 comments
Open

Speed up test execution #268

ecomodeller opened this issue Sep 29, 2023 · 5 comments

Comments

@ecomodeller
Copy link
Member

Is is possible to speed up some of these slow tests, or mark them as slow and only run them in CI?

$ pytest --durations=10
===================================================================================
3.30s call     tests/test_metrics.py::test_pr
1.47s call     tests/test_multivariable_compare.py::test_mv_mm_taylor
1.41s call     tests/test_multimodelcompare.py::test_mm_taylor
1.16s setup    tests/test_multivariable_compare.py::test_mv_mm_taylor
1.15s call     tests/test_multimodelcompare.py::test_mm_scatter
0.87s call     tests/test_combine_comparers.py::test_concat_model_different_time
0.80s call     tests/test_comparer.py::test_minimal_plots
0.79s call     tests/test_multimodelcompare.py::test_custom_metric_skilltable_mm_scatter
0.73s call     tests/regression/test_regression_rose.py::test_wind_rose_image_identical
0.60s call     tests/test_multivariable_compare.py::test_mv_mm_scatter
@jsmariegaard
Copy link
Member

I have been thinking the same - I would like the test suite to run faster

@jsmariegaard
Copy link
Member

How about reducing the file size of some key test data?

@ecomodeller
Copy link
Member Author

How about reducing the file size of some key test data?

Sure, the files should as small as possible but no smaller🙄

@ecomodeller
Copy link
Member Author

For now I think I will use https://testmon.org/ to only run tests that are affected by a code change to optimize the developer inner loop and then accept that it takes a few minutes to run all tests in CI.

@jsmariegaard
Copy link
Member

I am getting these:

================================================ slowest 10 durations =================================================
3.14s call     tests/test_multimodelcompare.py::test_mm_scatter
1.19s call     tests/test_comparer.py::test_minimal_plots
0.92s call     tests/test_multimodelcompare.py::test_mm_taylor
0.91s call     tests/test_combine_comparers.py::test_concat_model_different_time
0.86s call     tests/test_multivariable_compare.py::test_mv_mm_scatter
0.64s call     tests/test_trackcompare.py::test_hist
0.64s setup    tests/test_combine_comparers.py::test_concat_model_different_time
0.59s call     tests/regression/test_regression_rose.py::test_wind_rose_image_identical
0.53s call     tests/test_multivariable_compare.py::test_mv_mm_taylor
0.49s call     tests/test_multimodelcompare.py::test_custom_metric_skilltable_mm_scatter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants