Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi! Thanks for working on this!
I wanted to run tests (
mix test
) in the project and hit a couple of snags in a fairly fresh vanilla Ubuntu install (I can give details about them if you'd like, but it is not related to this issue at hand. There are a couple of dependencies that I didn't have, but were straightforward to add (cargo, cmake, llvm and friends).Once everything is set up and we are able to run things, there is a check in the
priv/repo/seeds_after_migration.exs
that will never succeed (making sure the roles are created). It's because we don't create them in tests, we only do it in dev (https://github.com/supabase/supavisor/blob/main/dev/postgres/00-setup.sql#L1-L3). At least, this is what I think at the moment (I may be wrong).What kind of change does this PR introduce?
Small test setup change, allows to run a
mix test
from the project root.What is the current behavior?
I got the following error when running locally:
What is the new behavior?
The roles are created in the test db successfully.
Additional context
Debugging sesh:
Add this diff (where my pg lives):
Try
mix test
:Add inspects with this diff:
We get:
I am getting a different error at the moment, but seems to be that my current Erlang install (26.0.2) didn't bring in the
ct_slave
module. Seems like there was some discussion about it here: https://github.com/supabase/supavisor/pull/31/files#r1145024804To keep this issue smaller, I replaced the
ct_slave
call with thepeer
one, expecting to get failed test. And that "works", the tests run.Hope this helps! Again, thanks for your work! ❤️
edit: I realize that the commit message and some of the wording above may incorrectly categorize this issue as a "test" db issue, but in fact, it's any db that it runs in. I approached this problem from "Cool project, let me run the tests" starting point. Please feel free to change the commit wording, the code, anything you'd like and also, if you don't use this, no problem at all. ❤️