We're hoping to use Shake to run many old Ruby tests in parallel. Many of these tests assume that they have sole control of the test database, so we have been creating multiple instances of the test database and running a test process against each one, running a subset of the overall tests sequentually.
Let's say we create 3 test databases. We can trivially create a resource with a capacity of 3 (newResource "RSpecTestDatabase" 3
) and state that an action needs to wait for one to be available (withResource rspecTestDataBase 1 $ ... do stuff ...
). Is there anyway to tell which one of the three databases we've been given so we can choose the correct connection string?