简体   繁体   English

在哪里放置 REST Assured 测试

[英]Where to put REST Assured tests

Is it a common practice to put REST Assured tests in the same project it will test, or in its own project?将 REST Assured 测试放在要测试的同一个项目中还是放在它自己的项目中是一种常见的做法吗? Like, I have a microservice called purchase which I will write the tests for.比如,我有一个名为 purchase 的微服务,我将为其编写测试。 Should the tests be in it, or should I create another project to do it, named some like purchase-integration-tests?测试应该在里面,还是我应该创建另一个项目来做它,命名为购买集成测试?

Thanks!谢谢!

I would like to share the practice which we use in our project:我想分享我们在项目中使用的实践:

Our microservice code is structured into multiple project with one parent.我们的微服务代码被构造成一个父级的多个项目。 Within the parent project we have below child projects:在父项目中,我们有以下子项目:

  1. Spec- Contains Swagger Spec规范 - 包含 Swagger 规范
  2. Service- Contains Service Code服务 - 包含服务代码
  3. Integration Tests集成测试
  4. Load tests负载测试

As part of the CI/CD pipeline, first the code is build and unit tested, then integration tests which are rest assured based are triggered where all your dependent services are mocked with the help of wiremock, then you have load tests.作为 CI/CD 管道的一部分,首先构建代码并进行单元测试,然后触发基于放心的集成测试,其中所有依赖服务都在 Wiremock 的帮助下进行模拟,然后进行负载测试。 Build is deployed to the environment after the successful, completion of all the projects.构建成功后部署到环境中,完成所有项目。

Apart from this we also have regression test cases written for specific environments using rest assured as independent project.除此之外,我们还有使用放心作为独立项目为特定环境编写的回归测试用例。

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

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