orlangure/gnomock

A preset generator

Closed this issue · 2 comments

A preset generator is needed to help developers develop any customized presets, e.g., REST Api client/server, grpc client/server and so on. A generalized interface could be good enough.

Hi @dreamofboy, thanks for bringing this up.

This is what I had in mind for a while now, let me know if it is similar to what you ask for.

I wanted to build a small code-generation tool that when executed (e.g $ generate preset jenkins) will create new files and update existing files with the following changes:

  1. New folder for a new preset at preset/jenkins
  2. preset.go, preset_test.go and options.go files as well as readme.md file in that folder
  3. The above files contain a bare minimum to count as a preset
  4. testdata folders with no actual data created in gnomockd and sdktest packages
  5. TestJenkins added to gnomockd tests
  6. A stub added to python sdk test
  7. Swagger spec is updated
  8. Maybe the main readme updated as well

I'm not sure how it helps with your idea of rest client/server and/or grpc client/server, but that's what I had in mind. With this tool you'll be able to bootstrap a new preset very quickly, but still will have to figure out how to implement it for it to be useful.

Let me know how close it is to what you had in mind.

I built an initial version of preset generator and updated our contribution guide:
https://github.com/orlangure/gnomock/blob/master/CONTRIBUTING.md#preset-generator