Ask HN: Microservices testing best practises?

https://news.ycombinator.com/item?id=12377248
by surprised_dev • 10 years ago
15 5 10 years ago

Hello fellow developers, architects, tech leads,

Two years ago In my current company we started migration into microservices. The whole project happen without any plan in place. microservices were created ad-hoc, when someone wanted to create something new or just migrated a part of monolith API. We end up having around 15 coupled services. The problem we are facing now are the tests. As we don't have client libraries - project were e.g. User microService is implemented, mock its methods during unit/functional test. Mocks are part of the project consuming this service. Integration tests are done manually on staging. Because of that if something in the given microservices changes we are unable to detect the problem (unless someone spots it on staging). It happens often as developers do not update mocks in depended projects. In future we will run integration testing in docker using endpoints not mock but first we have to migrate our build environment to support docker.

Few questions:

#1 If we writing integration testing to test flow that depends on e.g. 5-6 Microservices where this test should be stored, in the code base of the client applications or separated repo?

#2 Should we use client libraries that e.g. provided mocks for given microservice so if there is a change all depended projects will fail running functional tests?

#3 How you track releases between multiple projects, e.g. branch xxx from this website can only work with microservices that are using branch yyy? E.g. in case you would like to rollback website to the previous release. And at the time given microservice could change few times.

I would appreciate any feedback you can provide on microservices at your workplace.

Thanks!

Related Stories

Loading related stories...

Source preview

news.ycombinator.com