Replies: 4 comments 2 replies
-
Hey Aaron, it has been a while, what did you actually choose and would you still recommend it? |
Beta Was this translation helpful? Give feedback.
-
I actually experimented with all the different approaches you, @amerryma, mentioned, and ended up finding the prefix method (option 3) to be the easiest and cleanest solution for my use case. The prefix approach let me keep things simple. The keys were:
This let me share the database between tests and local dev, while keeping things tidy. Just had to be disciplined about cleaning up after each test run. In the end, the prefix method was the most straightforward way to get full integration tests running without too much overhead or risk of polluting my local env. Still requires a custom RPC function that needs to be modified to the size of affected tables. Also, it must maintain the order in which they reference each other. Still best possible solution. |
Beta Was this translation helpful? Give feedback.
-
So, one simple option I thought of was just simply changing the project name within |
Beta Was this translation helpful? Give feedback.
-
What I did is creating a different |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm working through a strategy for integration testing of a local Supabase instance. My integration suite is written with Jest and it uses the node pg driver to connect to the database and run assertions. It takes care of seeding and resetting the database. Right now my tests essentially use the Supabase CLI to start Supabase.
My problem comes from the fact that the Supabase CLI can only interact with a single database at a time, so if I want to run integration tests, it will affect my local development environment. I want to explore options where my integration tests don't need to worry about dealing with a shared database.
Options I've considered:
I've seen the discussions here and wondering if this is still the preferred method.
Beta Was this translation helpful? Give feedback.
All reactions