bernhardbuhl 922a9ad190 Bump 1.2.6 to 1.2.7 3 years ago
..
app 6ff770a214 Run TestRun on Local system functionality. 3 years ago
ini f974eecc45 run baangt Testruns with noCloneXls=False 3 years ago
patch 8ec82ed229 ui: import numbers & json support added 3 years ago
.dockerignore f2436e383d baangt subclasses support in docker 3 years ago
Dockerfile f974eecc45 run baangt Testruns with noCloneXls=False 3 years ago
Dockerfile.dev 579c3a2063 docker env for tests and services 3 years ago
Dockerfile.prev 579c3a2063 docker env for tests and services 3 years ago
Dockerfile.vig 8ec82ed229 ui: import numbers & json support added 3 years ago
Readme.md 444cbe6bc3 BAANGT -> baangt 3 years ago
app.py 334eb052b2 initial v0.1 3 years ago
config.py e8084dbf6f upload Testrun execution to file-service 3 years ago
requirements.txt 922a9ad190 Bump 1.2.6 to 1.2.7 3 years ago
runservice.dev.sh 579c3a2063 docker env for tests and services 3 years ago
runservice.rq.sh 579c3a2063 docker env for tests and services 3 years ago
runservice.sh 579c3a2063 docker env for tests and services 3 years ago

Readme.md

baangt Execution API

baangt Execution API provides service endpoints for executing baangt tests. The main features of the service are:

  • running the tests
  • storing test results to a database
  • uoloading test run results to baangt Data Files
  • retrieving the results of the finished tests

Environmental Variables

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

Redis Worker

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

Set-up

Before starting the baangt Execution API application you need just install the requirements from requirements.txt

pip install -r requirements.txt

Database

baangt Execution API service interacts with baangt Database

Subclasses

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

Run 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

API Reference

Base URL

http://[HOST_NAME]/v0.1

Run Tests from XLSX

POST [BASE_URL]/run/xlsx/
Requested files:
testrun: an XLSX file containing a Testrun definition
Response:
STATUS CODE: 202 Accepted
JSON: 
{
  "id": "[TESTRUN_UUID]"
}

Run Tests from JSON

POST [BASE_URL]/json
Requested JSON:
{
  "TESTRUN_NAME": {"TESTRUN_DEFINITION_OBJECT"}
}
Response:
STATUS CODE: 202 Accepted
JSON: 
{
  "id": "[TESTRUN_UUID]"
}

Get Testrun results as JSON

GET [BASE_URL]/results/json/[UUID]

UUID is fetched Testrun UUID as a string

Response:

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]"}
}