orlangure/gnomock

Request: More options for MySQL preset

zdunecki opened this issue · 2 comments

Hey,

I see awesome MySQL preset but at case in my company there are still missing some features. We need three things:

  • Run in root mode.
  • Don't choose database at start because we have multiple db's in single MySQL instance.
  • Mount Docker volumes. We use internal cache for seeds and it's saved in Docker volume.

Here's a quick sneak peek what I'm talking about in code:
https://github.com/orlangure/gnomock/compare/master...zdunecki:new-options-for-mysql-preset?expand=1

If you like this idea I'm able to finish this PR and add more tests, comments etc.

Hi @zdunecki and thanks for the ideas (and for using Gnomock 😻)

Numbers 1 and 2 are great and fairly simple, I think these 2 features can be merged very soon. Everything just needs to be tested properly, at least the happy flows, and documented (including swagger spec for non-Go users).

Number 3 is also very useful, but requires a deeper look. There is a way to run gnomock inside a container to access it from other languages using the API, and I'm not sure implementing volumes would be straightforward. I think it would "just work", but it needs a bit more attention. If you could confirm that it is possible to mount volumes in the same way using gnomock container as it is in Go, that would make adding this feature even easier 😼

@orlangure

Thanks for reply.

Number 3 looks very easy to implement, I did it here.

Gnomock itself require Docker engine and volumes looks like passing volume id/name similar to bind mount but it's not a local path but Docker area path. I'll test above features in Go and API mode, add tests and make code more robust.

Currently I've switched to another ticket at my company but I hope I'll back to this soon because we need this features internally.