简体   繁体   English

与微服务(NodeJS),Jenkins和Docker的集成测试

[英]Integration Tests with Microservices (NodeJS), Jenkins and Docker

How would you typically configure Jenkins to build microservices (multiple NodeJS services, Rabbit, Mongo, etc), then test those services all together ? 您通常如何配置Jenkins来构建微服务(多个NodeJS服务,Rabbit,Mongo等),然后一起测试这些服务?

Let's say I've the following services: 假设我有以下服务:

  • RabbitMQ 兔子MQ
  • Mongo 蒙哥
  • NodeJS Service 1 NodeJS服务1
  • NodeJS Service 2 NodeJS服务2

Each of them has their own tests (unit and integration) and their Dockerfile. 他们每个人都有自己的测试(单元和集成)和Dockerfile。

I want to configure Jenkins in a way that it would enable me to clone all theses services, run them all at the same time in different containers with Rabbit and Mongo containers along them. 我想以某种方式配置Jenkins,使我能够克隆所有这些服务,并在不同的容器中同时运行Rabbit和Mongo容器,同时运行它们。 It would then run the tests for each of those services (they do generate TAP and coverage reports). 然后,它将为每个服务运行测试(它们确实会生成TAP和覆盖率报告)。 Then take those reports for the TAP/Coverage Jenkins plugins. 然后将这些报告用于TAP / Coverage Jenkins插件。 If it works out, commit the image and push it to the docker registry. 如果可以解决,请提交映像并将其推送到Docker注册表。

I've been lying around Stack and Google and I don't really see an easy way to get there that would not imply tons of bash. 我一直在Stack和Google周围闲逛,但我真的没有找到一种简单的方法来实现这一目标,这并不意味着会有大量的抨击。

Maybe I see it in the wrong way, any input is more than welcome! 也许我以错误的方式看待它,欢迎任何输入!

You can test using an "consumer driven contract" approach. 您可以使用“消费者驱动的合同”方法进行测试。 Like mentioned here: https://medium.com/@sagansystems/integration-testing-our-microservices-for-fun-and-profit-b749ef42703b#.q7dyxgfrn using this project: https://github.com/realestate-com-au/pact 就像这里提到的那样: https : //medium.com/@sagansystems/integration-testing-our-microservices-for-fun-and-profit-b749ef42703b#.q7dyxgfrn使用此项目: https : //github.com/realestate-com -au / pact

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM