DatastoreTestContainer represents a runnable container for testing specific datastore engines.
| 20 | |
| 21 | // DatastoreTestContainer represents a runnable container for testing specific datastore engines. |
| 22 | type DatastoreTestContainer interface { |
| 23 | |
| 24 | // GetConnectionURI returns a connection string to the datastore instance running inside |
| 25 | // the container. |
| 26 | GetConnectionURI(includeCredentials bool) string |
| 27 | |
| 28 | // GetDatabaseSchemaVersion returns the last migration applied (e.g. 3) when the container was created |
| 29 | GetDatabaseSchemaVersion() int64 |
| 30 | |
| 31 | GetUsername() string |
| 32 | GetPassword() string |
| 33 | |
| 34 | // CreateSecondary creates a secondary datastore if supported. |
| 35 | // Returns an error if the operation fails or if the datastore doesn't support secondary datastores. |
| 36 | CreateSecondary(t testing.TB) error |
| 37 | |
| 38 | // GetSecondaryConnectionURI returns the connection URI for the secondary datastore if one exists. |
| 39 | // Returns an empty string if no secondary datastore exists. |
| 40 | GetSecondaryConnectionURI(includeCredentials bool) string |
| 41 | } |
| 42 | |
| 43 | type memoryTestContainer struct{} |
| 44 |
no outgoing calls
no test coverage detected
searching dependent graphs…