bernhardbuhl 922a9ad190 Bump 1.2.6 to 1.2.7 | 3 years ago | |
---|---|---|
.. | ||
app | 3 years ago | |
ini | 3 years ago | |
patch | 3 years ago | |
.dockerignore | 3 years ago | |
Dockerfile | 3 years ago | |
Dockerfile.dev | 3 years ago | |
Dockerfile.prev | 3 years ago | |
Dockerfile.vig | 3 years ago | |
Readme.md | 3 years ago | |
app.py | 3 years ago | |
config.py | 3 years ago | |
requirements.txt | 3 years ago | |
runservice.dev.sh | 3 years ago | |
runservice.rq.sh | 3 years ago | |
runservice.sh | 3 years ago |
baangt Execution API provides service endpoints for executing baangt tests. The main features of the service are:
You may use the following environmental variables to configure the baangt Execution API:
Variable | Default Value | Description |
---|---|---|
SECRET_KEY | secret!key | The secret key of the app |
DATABASE_URL | sqlite:///testrun.db | Database URL for baangt test results |
BAANGT_DATAFILE_HOST | 127.0.0.1:5050 | The host that runs baangt Data Files |
REDIS_URL | redis:// | The Redis connection URL |
baangt Execution API implements baangt test runs as the background tasks via Redis. So, firstly you need a running Redis server. The service uses the Redis Queue (RQ) worker named baangt-tasks
that based on the same code to run the baangt tests. At least one baangt-tasks
RQ worker should be running to support baangt Execution API service. Be sure to install requirements and setup environmental vars before starting the RQ workers.
pip install -r requirements.txt
export DATABASE_URL=[baangt_results_database_url]
export REDIS_URL=[your_redis_url]
rq worker baangt-tasks
Before starting the baangt Execution API application you need just install the requirements from requirements.txt
pip install -r requirements.txt
baangt Execution API service interacts with baangt Database
baangt Execution API service supports BAANG subclasses. You need just go to plugin
folder (api/plugin
folder in this repo) and clone (or paste) your subclasses there. For instance:
mkdir plugin
cd plugin
git clone https://gogs.earthsquad.global/athos/baangt-subclassingDemo.git
IMPORTANT!
Ensure, you add the subclasses to baangt UI Web-Service
Please use a Python WSGI Server to run the baangt Execution API application.
The application name is app
For example, to run the service with gunicorn use:
gunicorn -b :8000 --access-logfile access.log --error-logfile error.log app:app
http://[HOST_NAME]/v0.1
POST [BASE_URL]/run/xlsx/
testrun: an XLSX file containing a Testrun definition
STATUS CODE: 202 Accepted
JSON:
{
"id": "[TESTRUN_UUID]"
}
POST [BASE_URL]/json
{
"TESTRUN_NAME": {"TESTRUN_DEFINITION_OBJECT"}
}
STATUS CODE: 202 Accepted
JSON:
{
"id": "[TESTRUN_UUID]"
}
GET [BASE_URL]/results/json/[UUID]
UUID is fetched Testrun UUID as a string
Testrun is in progress:
STATUS CODE: 202 Accepted
JSON:
{
"id": "[TESTRUN_UUID]"
}
Testrun is finished:
STATUS CODE: 200 OK
JSON:
{
"id": "[TESTRUN_UUID]",
"Name": "[TESTRUN_NAME]",
"Summary": {"[TESTRUN_SUMMARY_OBJECT]"},
"GlobalSettings": {"[TESTRUN_GLOBALS_OBJECT]"},
"TestSequences": {"[TEST_SEQUANCES_OBJECT]"}
}