We should consider running our test suite with a real mongo database, it would allow better testing of mongo details, for example aggregate()
calls which mim
(mongo in memory) cannot emulate at this point.
Several things would have to change:
test.ini
Allura/allura/websetup/bootstrap.py
's wipe_database
method to include those database namesmim
is already isolated per-process since its in memory)"mim" is also a bit faster. In my single-process test run it was 70% the time of real mongo. So we'd be sacrificing some speed.
Not sure if applicable, but something I've stumbled upon recently: https://testcontainers.com/.
See:
- https://testcontainers-python.readthedocs.io/en/latest/README.html
- https://testcontainers-python.readthedocs.io/en/latest/mongodb/README.html
Perhaps this can help in the subject of this ticket.