Testing is rather slow
- Full
uv run --frozen pytest took over 19 minutes on my machine (on python 3.12)
- CICD on github takes about the same amount of time
Where the the time is going
Seems most of the time is the the test_packaged_table_configs_for_each_version (make sense):
- 5 workbooks × ~290 odd tables took roughly ~16 min.
This will presumably grow overtime as more workbooks added.
Drilling into that a bit more
- each table triggers 3x
pd.read_excel (table read, plus the left/right column checks).
- Some sheets are re-parsed a lot (e.g. the flow path forecast table has ~120 odd tables).
--cov-branch adds a chunk time too
Potential options
- Switch to
calamine engine (rust based alternative to openpyxl) - could more than halve time?
- Could potentially parallize some of the tests (
pytest-xdist) since workbook configs are are independent.
- Large refactor (probably not worth it) to load and parse sheets only once. Lot of the parsing is then redundant. Also maybe not necessary if switch to
calamine.
- dropping
--cov-brnach or only running that on one of the jobs (doesn't make sense to run that on all 15 os/py versions).
Testing is rather slow
uv run --frozen pytesttook over 19 minutes on my machine (on python 3.12)Where the the time is going
Seems most of the time is the the
test_packaged_table_configs_for_each_version(make sense):This will presumably grow overtime as more workbooks added.
Drilling into that a bit more
pd.read_excel(table read, plus the left/right column checks).--cov-branchadds a chunk time tooPotential options
calamineengine (rust based alternative toopenpyxl) - could more than halve time?pytest-xdist) since workbook configs are are independent.calamine.--cov-brnachor only running that on one of the jobs (doesn't make sense to run that on all 15 os/py versions).