简体   繁体   English

如何使用docker-compose测试python应用程序?

[英]How test python application with docker-compose?

So, I have microservice application on python with some services.因此,我在python上有一些服务的微服务应用程序。 Each service has his own database.每个服务都有自己的数据库。 And it's all configurations are written in docker-compose.yml file.而且所有配置都写在docker-compose.yml文件中。

And now I need test for example one service with unit test.现在,我需要测试,例如一项带有单元测试的服务。 How can I do it?我该怎么做? When I need to locate unites files?什么时候需要查找文件? How create container for tests and configure and start application in this?如何在其中创建用于测试的容器以及配置和启动应用程序? How can I create container with database for test?如何创建带有数据库的容器以进行测试? How can I create test data and rollback database after it?之后如何创建测试数据和回滚数据库? How I should manage tests?我应该如何管理测试?

So, I have microservice application on python with some services.因此,我在python上有一些服务的微服务应用程序。 Each service has his own database.每个服务都有自己的数据库。 And it's all configurations are written in docker-compose.yml file.而且所有配置都写在docker-compose.yml文件中。

And now I need test for example one service with unit test.现在,我需要测试,例如一项带有单元测试的服务。 How can I do it?我该怎么做? When I need to locate unites files?什么时候需要查找文件? How create container for tests and configure and start application in this?如何在其中创建用于测试的容器以及配置和启动应用程序? How can I create container with database for test?如何创建带有数据库的容器以进行测试? How can I create test data and rollback database after it?之后如何创建测试数据和回滚数据库? How I should manage tests?我应该如何管理测试?

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

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