coralnet
coralnet copied to clipboard
Get Selenium tests working again (locally)
Selenium tests are basically our way of testing Javascript behavior.
Per this comment, we previously limited Selenium unit tests to the SQLite database, because it was the only available database backend that doesn't accept multiple DB connections, and multiple connections present a problem in our Selenium tests.
Then we started using the Django JSONField which was PostgreSQL-only, so we could no longer run tests in SQLite, and hence we could no longer run our Selenium tests.
Possible ways to get Selenium tests working again:
-
Update to Django 3.1 and start using its DB-agnostic JSONField, so that those fields can work in SQLite.
-
See if there is a convenient way to run PostgreSQL while restricting to a single DB connection. I'm not sure if I thought to look this up before. This would be a good solution if it works, since it's otherwise preferable to stick to PostgreSQL for tests (to keep behavior similar to production).
- (EDIT) Could try django-postgrespool2 with
pool_size
1,max_overflow
0. Only use this for development environments of course.
- (EDIT) Could try django-postgrespool2 with
-
See if there's a way to rework our Selenium tests in a way that multiple DB connections can't mess them up. I'm pretty sure I did look into this, but I could have missed something, or maybe Django has made better options available by now.
This is just to get Selenium tests working locally. I don't remember if we ever got them working in our continuous-integration systems or not. That'd be ideal to have also, but I'm not really sure what it'd involve. That can be a separate issue once this is taken care of.