baangtDB - the big brother of baangt UI and CLI
bernhardbuhl 99b2d91083 Updates KFZ, RS, Wohnen | 3 years ago | |
---|---|---|
api | 3 years ago | |
files | 3 years ago | |
mysql | 3 years ago | |
postgres | 3 years ago | |
ui | 3 years ago | |
.gitignore | 3 years ago | |
Readme.md | 3 years ago | |
baangt_services.png | 3 years ago | |
docker-compose.dev.yml | 3 years ago | |
docker-compose.mysql.yml | 3 years ago | |
docker-compose.test.yml | 3 years ago | |
docker-compose.yml | 3 years ago | |
requirements.test.txt | 3 years ago | |
run_services_db_permanent.sh | 3 years ago | |
run_services_in_docker.sh | 3 years ago | |
run_services_with_mysql.sh | 3 years ago | |
run_tests.sh | 3 years ago | |
start_mysql_container.sh | 3 years ago | |
stop_docker.sh | 3 years ago |
baangt Web-Services provide a simple way to define and run tests within baangt test suite.
baangt UI Web-Service — Web UI providing functionality for definition of the baangt tests including import and export features
baangt Execution API — Service endpoints for running and retrieving results of the baangt tests
baangt Data Files — File storage service to handles baangt Data Files
baangt Services are available in docker containers. Just execute
./run_services_in_docker.sh
Script run_services_in_docker.sh
builds 3 baangt images:
baangt-file:latest
(baangt Data Files)baangt-api:latest
(baangt Execution API)baangt-ui:latest
(baangt UI Web-Service)and runs 6 docker containers on the default ports:
postgres
(baangt database on port 5430)redis
(Redis server on port 6380)rq-worker
(Redis Queue worker)baangt-file
(baangt Data Files on port 5050)baangt-api
(baangt Execution API on port 5000)baangt-ui
(baangt UI Web-Service on port 80)The script accepts the following optional arguments:
Argument | Description |
---|---|
-ui {PORT} | customize running port for baangt-ui container |
-api {PORT} | customize running port for baangt-api container |
-df {PORT} | customize running port for baangt-file container |
-rd {PORT} | customize running port for redis container |
-ps {PORT} | customize running port for postgres container |
-b | skip building docker images |
stop | stop all six baangt containers |
For example, to use existing baangt images and run baangt UI Web-Service on port 8080 use:
./run_services_in_docker.sh -b -ui 8080
To stop all baangt containers use:
./run_services_in_docker.sh stop
NOTE:
The described above method launches baangt Services with the following databases:
sqlite:///testrun.db
(within docker container baangt-ui
)postgres
Alternatively, you may start docker container with two MySQL databases (definition
for baangt Testrun definitions and execution
for baangt Testrun results) by executing
./start_mysql_container.sh
with optional parameter that specifies the MySQL running port.
Wait until the status of the mysql
container will be healthly: see STATUS under docker ps
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8bb944f3de6b mysql-baangt:latest "/entrypoint.sh mysq…" 25 minutes ago Up 24 minutes (healthy) 33060/tcp, 0.0.0.0:3305->3306/tcp mysql
Then execute
./run_services_with_mysql.sh
to launch the other needed containers.
For the long-term testing you may want to use permanent databases (local or permanent docker containers -- without attribute --rm
). To achieve that just adjust the values of the environmental variables DATABASE_URL
in a run_services...sh
script
docker run -d --name rq-worker... -e DATABASE_URL=<url_of_baangt_testrun_RESULTS_database>...
docker run -d --name baangt-api... -e DATABASE_URL=<url_of_baangt_testrun_RESULTS_database>...
docker run -d --name baangt-ui... -e DATABASE_URL=<url_of_baangt_testrun_DEFINITIONS_database>...
As an example you may try the run_services_db_permanent.sh
script. It builds baangt-postgres:latest
image and runs baangt-postgres
container with two databases:
definition
holds baangt Testrun definitionsexecution
holds baangt Testrun resultsThe container is run without --rm
flag and could be reused again on the next execution of the run_services_db_permanent.sh
script.
IMPORTANT!!!
Using the command
docker container prune
will delete the baangt-postgres
when it is stopped.