@rachids You could just shift your tests to use mysql. It is slower but there is an argument to be made for this case and also aligning to test against the exact same db you use in prod.
Aug 17, 2020
3
Level 3
Approach for testing a multi-tenant app.
Hello artisans, hope you are all doing well.
I am building a multi-tenant app and I am using the spatie/laravel-multitenancy package with single-domain / multiple db.
Everything is working great but I'd like to create some tests along the way and I hit a wall.
For instance, I want to test my signup process which goes like this :
- User submit the signup form
- I create the Tenant instance
- Tenant instance generate a database
- I make this tenant the current one
- I create the user and some initial data
How would you test this knowing that the second part (creating the database) seems not possible with sqlite configured as in-memory ?
I'd like to have some insights from other developers and maybe get an occasion to improve my understanding of testing and working under multi-tenant context.
Thanks all for reading me.
Level 67
1 like
Please or to participate in this conversation.