Tests: configure in-memory database #81291
Labels
No Label
Priority
High
Priority
Low
Priority
Normal
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Content
Type
Design
Type
Report
Type
To Do
Type
Web Development
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: studio/blender-studio#81291
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tests currently require PostgreSQL instance running, which makes them slow.
It would be better to use in-memory sqlite instead, however this requires database migrations reset and PostgreSQL-specific queries removed from them.
Added subscriber: @railla
Added subscriber: @chr.schmitz
There are quite a few changes that would be required to make current tests work with sqlite, not all of them are contained in the migrations and can be solved by a reset (which is pretty much impossible with a live production database):
some in migrations caused by lacking support for most
ALTER
s (1),some due to sqlite-specific bugs in Django's migrations framework (2),
some due to PostgreSQL-specific query syntax or other syntax lacking support in sqlite (3)
After spending a few hours on this, I got past the issues from categories (1) and (2) to a point when tests were running, but failing due to (3).
At this point it's becoming clear that having tests run with sqlite while having postgresql production is pointless considering how many engine-specific problems there are so far.
Keeping the diff of changes required to get the tests running here for posterity, in case this gets abandoned after all.