You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all thank you for this open source library, we benefit from it every day!
We recently ran into a problem when we want to swap config variable for end to end tests. Since we do not know before hand the PID for started process we had fail to do it.
Thanks for the feedback! It's very encouraging to hear.
So far I've tried to avoid the need for global mocks. For Phoenix with Wallaby, I do this: https://hexdocs.pm/gestalt/overview.html#acceptance-tests. One thing that I've done (in closed-source code, so I can't point you directly at it) is to put a delay between init and actual message handling in a GenServer, and run Gestalt.copy(test_pid, genserver_pid). So in my test I'll use start_supervised, grab the pid, and then swap over config for the genserver pid.
I think it would take me a while to figure out how to do a global override in a way that's safe, with my current workload. If you're not able to find a way to make an override for your pid, but were able to do a first pass at a pull request in the next day or two, it would be more likely that I'd be able to merge (or finish it up) than that I'd make the change from scratch.
If that's not viable, I'm likely more available after this week. I'm happy to continue this conversation in the meanwhile, to figure out the best way to implement this. Maybe something close to how Mox handles it internally?
First of all thank you for this open source library, we benefit from it every day!
We recently ran into a problem when we want to swap config variable for end to end tests. Since we do not know before hand the PID for started process we had fail to do it.
Would it be possible to use gestalt for all processes globally, similar as we do for
Mox.set_mox_global
:https://hexdocs.pm/mox/Mox.html#set_mox_global/1 ?
Or is there another way we can swap config variables for all subsequent calls in tests?
The text was updated successfully, but these errors were encountered: