| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
Main language: Groovy. Project functional tests use Spock as a main testing framework. Also used Docker for running PBS and other services. Testcontainers is used as provider of lightweight, throwaway instances of PBS, MySQLContainer, MockServerContainer containers. And MockServer for mocking external services.
To prepare the PBS image, follow these steps from the root directory:
mvn clean -B package -f extra/pom.xml
2.1 Build image without modules:
mvn docker:build -f pom.xml
2.2 Build image with modules:
mvn docker:build -f pom.xml -DdockerfileName=Dockerfile-modules
Note: Don't forget to rebuild the image for manual test start after making changes in the dev code.
You have two options for running functional tests:
mvn -B verify -DskipModuleFunctionalTests=true
You have two options for running modular tests:
mvn -B verify -DskipUnitTests=true -DskipFunctionalTests=true -DskipModuleFunctionalTests=false -DdockerfileName=Dockerfile-modules
Functional tests need to have name template .*Spec.groovy
Properties:
launchContainers - responsible for starting the MockServer and the MySQLContainer container. Default value is false to not launch containers for unit tests. tests.max-container-count - maximum number of simultaneously running PBS containers. Default value is 5. skipFunctionalTests - allow to skip funtional tests. Default value is false. skipUnitTests - allow to skip unit tests. Default value is false.
Debug:
An application running inside a Docker container is treated as a remote application, so you can attach the debugger to it.
In order to obtain the debug port you need to use <tests.fixed-container-ports> property in pom to true by default false. Next several ports will expose when <tests.fixed-container-ports> is true.
Every container expose random port which you can see docker ps - running containers. (add flag -a to see exited containers)
You can observe logs inside container docker logs <container_id>. (You don't need to write all id, just use 2-3 symbols)
Container for mocking different calls from PBS: prebid cache, bidders, currency conversion service, PubStack analytics, http data source
/auction - default mocked bidder call returns response based on information from request:
{
"id":"0a00b9a1-06c0-4001-9d64-b6a3f7d995e6",
"seatbid":[
{
"bid":[
{
"id":"c550cf25-3a09-480b-852f-e75a009bbefd",
"impid":"b9a2756a-6aef-438c-85ed-53331a7b4c53",
"price":1.23,
"crid":"1"
}
]
}
]
}
/cache - mocked PBC call returns:
{
"responses":[
{
"uuid":"8565b07a-8a64-476b-ac68-cc09b4560625"
}
]
}
Container for Mysql database.
Container for PostgreSQL database.
Starting image prebid/prebid-server:latest. Waits for container is ready by checking "/status" endpoint.
TestContainer will start special Ryuk container which will manage a lifecycle of all depending containers.
| Back | FazBrowse Home | New Git URL |