Edition 0 Updated to asp. Net core 0


Microservice functional/integration tests



Yüklə 11,82 Mb.
Pdf görüntüsü
səhifə142/288
tarix12.07.2023
ölçüsü11,82 Mb.
#136458
1   ...   138   139   140   141   142   143   144   145   ...   288
Microservice functional/integration tests
, with test cases involving the infrastructure for each 
microservice but isolated from the others and are contained in the 
{MicroserviceName}.FunctionalTests
projects. 
3.
Application functional/integration tests
, which focus on microservices integration, with test 
cases that exert several microservices. These tests are located in project 
Application.FunctionalTests

While unit and integration tests are organized in a test folder within the microservice project, 
application and load tests are managed separately under the root folder, as shown in Figure 6-25. 
Figure 6-25. Test folder structure in eShopOnContainers 
Microservice and Application functional/integration tests are run from Visual Studio, using the regular 
tests runner, but first you need to start the required infrastructure services, with a set of docker-
compose files contained in the solution test folder: 
docker-compose-test.yml
version:
'3.4'
services:
redis.data:
image:
redis:alpine
rabbitmq:
image:
rabbitmq:3-management-alpine


157 
CHAPTER 5 | Designing and Developing Multi-Container and Microservice-Based .NET Applications 
sqldata:
image:
mcr.microsoft.com/mssql/server:2017-latest
nosqldata:
image:
mongo
docker-compose-test.override.yml
version:
'3.4'
services:
redis.data:
ports:
-
"6379:6379"
rabbitmq:
ports:
-
"15672:15672"
-
"5672:5672"
sqldata:
environment:
-
SA_PASSWORD=Pass@word 
-
ACCEPT_EULA=Y 
ports:
-
"5433:1433"
nosqldata:
ports:
-
"27017:27017"
So, to run the functional/integration tests you must first run this command, from the solution test 
folder: 
docker-compose -f docker-compose-test.yml -f docker-compose-test.override.yml up 
As you can see, these docker-compose files only start the Redis, RabbitMQ, SQL Server, and MongoDB 
microservices. 

Yüklə 11,82 Mb.

Dostları ilə paylaş:
1   ...   138   139   140   141   142   143   144   145   ...   288




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin