Skip to content

TestExecutor

Tomasz Kaik edited this page May 29, 2019 · 5 revisions

Test Executor

The Test Executor module is a part of Web API and an entry point of the test suite processing. It exposes endpoints which client applications can use to run the test suite and check the processing status by sending the simple HTTP requests.

The heart of this module is the SuiteExecutor OSGi service. This service is responsible for starting the test suite execution and storing the processing status. It communicates directly with the AET Runner via ActiveMQ.

Endpoints

The Test Executor module exposes two endpoints. First is responsible for running provided test suite and the second provides the suite processing status.

Base path for both endpoints:

http://<Domain_or_IP_Address>:<PORT>

Run suite
Request
  • URL: /suite
  • HTTP Method: POST
  • Parameters:
    • suite - xml file content with the suite definition
    • domain - overrides domain specified in the suite xml file
    • pattern - id of suite that will be used as patterns source
    • name - overrides the name parameter value from the sute xml file
  • Description: Schedules processing suite passed in the suite parameter. Returns unique correlationId of the scheduled suite run or errorMessage in case of failure in form of application/json. The request's content type has to be multipart/form-data.
Response

This endpoint returns JSON object with following fields:

Field Description
correlationId Correlation ID of the suite run, used to check the processing status.
statusUrl URL under which the processing status is available.
htmlReportUrl Link to HTML report generated by the suite run.
xunitReportUrl Link to xUnit report generated by the suite run.
errorMessage Contains an error message. Only this field will be present if suite start fails.
Rerun suite
Request
  • URL: /api/suite-rerun
  • HTTP Method: POST
  • Parameters:
    • correlationId - Correlation ID of the suite to rerun, used to get it from the database
    • suite - Name of suite, used to get model from the database in case of correlactionID was not provided
    • company - company name used to create database key
    • project - project name used to create database key
    • testName - name of test used to rerun test or used to identify how test should be applied for rerun url, do not provide this parameter for rerun whole suite
    • testUrl - name of url used to rerun url. In case of rerun whole suite or whole test do not provide it
  • Description: This endpoint can execute suite. In case when you provide testName it override your test's result in the database or if you provide testName and testUrl it overrides only url's result in the database. If you do not provide additional parameters this endpoint just runs suite and creates new version in database - it doesn't override old information.
Response

This endpoint returns the same JSON as in case of run suite using /suite endpoint.

Get suite processing status
Request
  • URL: /suitestatus/<correlationId>
  • HTTP Method: GET
  • Parameters:
    • correlationId - correlation ID of the suite run, which is returned in response to the suite run request.
  • Description: Returns processing status of the suite run identified by correlationId or 404 if suite can't be found in the system. Please note that the Run suite request returns full URL from which the processing status can be obtained.
Response

This endpoint returns JSON object with following fields:

Field Description
status Processing status. Available values: PROGRESS, ERROR, FATAL_ERROR, MISSING_DATABASE, FINISHED, UNKNOWN
message Detailed message associated with status (might be empty).

SuiteExecutor service

This service processes the requests sent to endpoints. It parses provided suite file, locks the test suite and sends it to the Runner. It starts the threads that receive progress messages from Runner and stores the statuses in cache.

The service returns processing status when requested. It returns one status at a time and removes it from cache, so the status message can be obtained only once. When there are no status requests made for a specified amount of time, then the statuses for the specific suite run are removed from the cache permanently.

The ActiveMQ message receive timeout can be configured in the OSGi Console, under the AET Suite Executor entry. It is specified in milliseconds.

Clone this wiki locally