RTXteam / RTX

Software repo for Team Expander Agent (Oregon State U., Institute for Systems Biology, and Penn State U.)
https://arax.ncats.io/
MIT License
34 stars 20 forks source link

Auto-update databases and KP info cache when running pytest suite #2263

Closed amykglen closed 2 months ago

amykglen commented 2 months ago

currently in order to run the ARAX pytest suite on a development machine (i.e., one that doesn't have the actual Flask application running), you have to manually run the KPInfoCacher on a daily basis. if you don't, you get somewhat vague errors about being unable to load KP info caches (#2252).

you also have to remember to run the ARAXDatabaseManager periodically to ensure you have the latest databases. otherwise some tests may fail and it's not at all obvious why. (#2262)

this is pretty inconvenient and non-intuitive.

so I just added some code to our conftest.py that makes pytest run both the KPInfoCacher and the ARAXDatabaseManager at the beginning of each testing session. if the KP info cache has been updated within the last hour it will skip refreshing that. and the database manager of course only downloads missing databases.

I don't think this should disturb things on our docker instances (i.e. arax.ncats.io and cicd.rtx.ai), since databases and the KP info cache on those instances should always be current, meaning no downloads/refreshing should happen when the pytest suite is run on those instances. really these changes should just make dev work more convenient.

I'm not sure whether these changes should go in dev or master so they're in a branch for now! (issue2263)

amykglen commented 2 months ago

also once this is merged into master, we should remember to update the ARAX wiki to remove the steps about manually running kp_info_cacher.py.

edeutsch commented 2 months ago

I think good to go into master and get tested by us over the next week

amykglen commented 2 months ago

alright, pushed to master!

dkoslicki commented 2 months ago

This worked for me just now, so everything is looking good! Thanks Amy!

amykglen commented 2 months ago

alright, I think we're good to close this issue then! although @dkoslicki (or @chunyuma) - do we want to remove this part from the ARAX wiki now that this is done automatically? https://github.com/RTXteam/RTX/wiki/Dev-info#if-you-see-xdtd-tests-failing-please

dkoslicki commented 2 months ago

Removed! Thanks Amy