对于微服务,我是否需要像这样为每个服务的每个版本创建测试文件夹:
一个
- Services
- users
- v1
- src
- tests
- functional
- unit
- integration
- v2
- src
- tests
- functional
- unit
- integration
- v3
- src
- tests
- functional
- unit
- integration
B
- Services
- users
- v1
- src
- v2
- src
- v3
- src
- tests
- functional
- unit
- integration
C
- Services
- users
- v1
- v2
- v3
- tests
- functional
- integration
- unit
D
- Services
- users
- v1
- v2
- v3
- Tests
- functional
- integration
- unit
最佳答案
通常你会得到这样的结果
- Solution
- IntegrationTestsFolder
-IntegrationTestsProject1
-IntegrationTestsProject2
- BusinessLayerProject
- BusinessLayerTestProject
因此您将在目标代码附近进行测试。
您不太可能拥有与单元一样多的集成测试项目,并且它们可能未与源项目一对一映射,因此您可能希望将它们全部嵌套在 IntegrationTests
文件夹。
至于版本控制,您真的对所有内容都进行了双重/版本控制吗?如果您最终得到几个不同版本的类,您可以在实际的单元/集成测试中单独针对它们。
关于unit-testing - 对微服务的每个版本进行一组测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39323491/