Garden-AI / garden

https://garden-ai.readthedocs.io
MIT License
17 stars 4 forks source link

383 don't run tests during publication #393

Closed OwenPriceSkelly closed 7 months ago

OwenPriceSkelly commented 7 months ago

Closes #383

Overview

functions decorated with @entrypoint_test now become no-ops at publication (and notebook debug) time, so users don't need to remember to comment out tests before they publish.

Discussion

containers.build_notebook_session_image can now set environment variables in the docker image it builds. This currently just sets a GARDEN_SKIP_TESTS=True flag by default, which the entrypoint_test decorator now checks for before calling the underlying test function.

Testing

Just manual tests so far -- I wasn't sure how useful a unit test would be since this only changes behavior in containers, but I'm happy to add one

As a bonus though, manual testing actually turned up a lil bug in notebook debug (we were attempting to pull images by an id which would only exist locally) 🪲

Documentation

Updated the template notebooks with a little explanation/usage of the decorator, but no actual docs changes otherwise.


📚 Documentation preview 📚: https://garden-ai--393.org.readthedocs.build/en/393/