官术网_书友最值得收藏!

Evolving your test suite

Having a good test suite in the first place will help tremendously as you move from a monolith to microservices. Each time you remove functionality from your monolith code base, your tests will need to be updated. It's tempting to replace unit and functional tests in your Rails app with tests that make external network calls to your services, but this approach has a number of downsides. Tests that make external calls will be prone to failures caused by intermittent network connectivity issues and will take an enormous amount of time to run after a while.

Instead of making external network calls, you should modify your monolith tests to stub microservices. Tests that use stubs to represent calls to microservices will be less brittle and will run faster. As long as your microservices satisfy the API contracts you develop, the tests will be reliable indicators of your monolith code base's health. Making backwards-incompatible changes to your microservices is another topic that will be covered in a later recipe. 

主站蜘蛛池模板: 遵化市| 眉山市| 三原县| 邵阳县| 武隆县| 蕉岭县| 衡水市| 科尔| 临桂县| 庆云县| 丹阳市| 金昌市| 岳池县| 酒泉市| 茌平县| 隆昌县| 辽宁省| 安福县| 宾川县| 耿马| 长沙县| 扶风县| 兴和县| 宝丰县| 弥勒县| 曲靖市| 定结县| 甘洛县| 建水县| 习水县| 德保县| 澄江县| 安岳县| 美姑县| 广昌县| 肇州县| 邢台县| 宁安市| 萍乡市| 鹤岗市| 太原市|