{"id":14369,"date":"2019-12-26T17:03:23","date_gmt":"2019-12-26T11:33:23","guid":{"rendered":"https:\/\/cigniti.com\/blog\/?p=14369"},"modified":"2022-07-28T21:18:45","modified_gmt":"2022-07-28T15:48:45","slug":"microservices-testing-quality-gates-model","status":"publish","type":"post","link":"https:\/\/www.cigniti.com\/blog\/microservices-testing-quality-gates-model\/","title":{"rendered":"How to establish quality gates in a Microservices architecture"},"content":{"rendered":"

Note: This is in continuation to the blog –\u00a0<\/span><\/i>Best testing strategies in a Microservice architecture<\/span><\/i><\/a>\u00a0– contributed by our SME, Chandra Kiran Mamidala.<\/span><\/i>\u00a0<\/span><\/p>\n

Let us a<\/span>ssume that\u00a0<\/span>you<\/span>\u00a0have implemented the strategy\u00a0<\/span>for\u00a0<\/span>testing\u00a0<\/span>microservices<\/span><\/a>\u00a0<\/span>as discussed\u00a0<\/span>and written all the test suites<\/span>\u00a0as suggested. Where do you run them?<\/span>\u00a0How do you make sure all your test suites are executed at right time and at right place (environment)? When do you run your regression packs?\u00a0<\/span>D<\/span>o all these\u00a0<\/span>test\u00a0<\/span>suites fit in CI\/CD?<\/span>\u00a0<\/span><\/p>\n

I<\/span>\u00a0will try to address most of these<\/span>\u00a0questions with an approach that we call<\/span>\u00a0\u201cQuality Gates model as a<\/span>\u00a0strategy to test<\/span>\u00a0microservices\u201d.<\/span>\u00a0This approach involves construction of<\/span>\u00a0quality gates into the CI\/CD\u00a0<\/span>pipeline\u00a0<\/span>for which we take the<\/span>\u00a0help of our development teams, build teams, deployment<\/span>,<\/span>\u00a0<\/span>and<\/span>\u00a0infrastructure teams.<\/span>\u00a0As the construction of quality gates is a test architecture activity that requires highly technical QA resources, it is essential that all the members across different teams work very closely. More importantly, you should first propose the Quality gates strategy to your stakeholders and obtain the required support from them.<\/span>\u00a0<\/span><\/p>\n

The following flow diagram offers a bird\u2019s eye view to the overall architecture with Quality gates established within the CI\/CD pipelines. I will explain each stage of\u00a0<\/span>the\u00a0<\/span>Quality gate<\/span>\u00a0strategy<\/span>\u00a0one by <\/span><\/p>\n

one:<\/span>\u00a0<\/span><\/p>\n

\"\"<\/p>\n

Quality Gate 1:<\/span><\/b>\u00a0<\/span><\/b>Execute\u00a0<\/span><\/b>Unit Tests<\/span><\/b>\u00a0<\/span><\/p>\n

At this stage, developers\u00a0<\/span>commit<\/span>\u00a0and push<\/span>\u00a0<\/span>the<\/span>\u00a0code to their branch<\/span>es<\/span>\u00a0where it<\/span>\u00a0undergoes reviews and merges. When the code is merged to a master copy<\/span>,<\/span>\u00a0we ensure that a build pipeline is triggered to run all<\/span>\u00a0the<\/span>\u00a0unit tests against the master copy.<\/span>\u00a0<\/span><\/p>\n

Things to consider:<\/span><\/b>\u00a0<\/span><\/p>\n