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

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. 

主站蜘蛛池模板: 虹口区| 大厂| 大余县| 靖江市| 余庆县| 垣曲县| 乌拉特前旗| 龙胜| 永昌县| 嘉祥县| 新丰县| 黄梅县| 姜堰市| 融水| 申扎县| 六枝特区| 太原市| 游戏| 略阳县| 芜湖市| 农安县| 台安县| 神池县| 博白县| 绍兴市| 芷江| 桑日县| 湛江市| 江安县| 寿光市| 宣武区| 都安| 邳州市| 赤壁市| 田阳县| 西充县| 子长县| 喀喇| 汉沽区| 休宁县| 山东省|