-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DB migrations tests #899
Conversation
@dessalines is it possible to get hardware acceleration in the pipeline? The migrations need to run as a instrumentation test which needs to run in a emulator which needs hardware acceleration to run. So I am unable to add this check to the CI. |
I don't know if that android image supports it. God that's annoying that a full emulator is required just to test some migrations.
iirc its necessary for synchronous queries, esp the |
All instrumentation tests will need it else it will take like 2 hours what would take 5minutes. Well that check exists so what we dont do any DB queries on ui thread. If we are hitting that check we should instead fix the issue and not disable the check. I'll maybe look into it but that's not for this pr. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see the migration tests being run: https://woodpecker.join-lemmy.org/repos/137/pipeline/494/6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I take it we'll need to remember to add these json files (which should be auto-generated), as part of the migration PR? I assume the lint will fail otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the schema of current version gets generated each time when run. This is needed for the migration test to compare the version after migration to the outputted schema of the actual DB.
It is not possible to add the migration tests without hardware acceleration. Thus i removed them from CI. But i added comment that devs who add migrations should check it. |
Gotcha. In that case I'm good with merging as is. |
Adds DB migration tests.
Added it to woodpecker too.
The tests need the schemas thus they are included in git. (They were a PITA to get)
Btw why are we allowing queries on the main thread? @dessalines
Fixes #898