We've been bitten by Zen Queries a few times (including with a production outage). I think we can replace this dependency with unit tests that use the Django test client and the django_assert_num_queries fixture. This will tell us about errors when we run our tests rather than at runtime. It should also provide developers with a more obvious error message that they can debug and fix (example one, example two).
We've been bitten by Zen Queries a few times (including with a production outage). I think we can replace this dependency with unit tests that use the Django test client and the
django_assert_num_queries
fixture. This will tell us about errors when we run our tests rather than at runtime. It should also provide developers with a more obvious error message that they can debug and fix (example one, example two).We are already doing this in some places, such as the unauthenticated index page: https://github.com/opensafely-core/job-server/blob/327fbd971c28d8b19bcc6f96fa39502c1afa8589/tests/unit/jobserver/views/test_index.py#L70-L78
As another example, a test for the JobDetail page might look like this (slack :thread: ):