Test/Mock Tools in Go

Trevor.Conn@...
 

Dell Customer Communication

Hi all – I assigned myself an issue yesterday for taking a small piece of the EdgeX core services and refactoring toward greater unit test coverage. I believe that some of the techniques I first introduced to the codebase in the holding repo will be of benefit in this regard. However in order to accomplish that, I need help from mocking tools. At the time I created that holding repo project, I evaluated several tools in the Go ecosystem and the ones I settled on are:

 

Mockery – Used for creating mock types from interfaces, eliminates writing of boilerplate code.

Testify – Used for implementing test conditions and evaluations within mocked methods

 

I chose these because they were flexible and seemed to have the least overhead for integration. One of the other ones I looked at was Ginkgo but it seemed like overkill.

 

I am asking to see if anyone has strong feelings in this area about a particular package. If so, please call it out and I’ll take a look. Otherwise, does anyone have issues with using the above packages?

 

Trevor Conn

Senior Principal Software Engineer

Dell Technologies | IoT DellTech

Trevor.Conn@...

Round Rock, TX USA

 

Join EdgeX-GoLang@lists.edgexfoundry.org to automatically receive all group messages.