I’ve implemented this mostly as specified in the original post:
https://github.com/discourse/discourse/commit/97e211f8372993622698aceb3eeb801a150aa9e5
I also went in and replaced all the mock tests with integration tests and added a separate commit for the clean up job.