PATH: StartRun
Introduction
A REST-S-REQUEST to the RestTestLuaService with a URI path ending in /StartRun
requests that a new Test Run be initiated, consisting of one or more Lua instances.
The REST-S-RESPONSE response in the case of failure is a 500 status code with a
text/plain error message body.
Start Run
The attributes of the test run are supplied as follows:
| Field | Type | Description |
|---|---|---|
query_args
|
Table |
The listed query args (the ?arg=value&arg2=value2 part of the URI) are supported.
|
run_id
|
String |
This must be a unique run ID. It cannot refer to any current or recent Test Run. The run ID is used for subsequent polling for run completion, or for cancellation. The run ID is used as the script key for the management API and for the SCRIPT_KEY global variable.
|
Method
|
POST
|
[Required] The method of the REST Request should be POST.
|
Header: Content-Type
|
String |
[Required] The Content-Type header must be "multipart/form-data" with Boundary marker.
|
Content
|
Array of Parts |
[Required] The Content must be the multipart form data, delimited by the Boundary marker. There are two mandatory parts, with additional optional parts for side-loaded Lua require libraries. |
test_details
|
JSON Object |
[Required] The test details is a mandatory element in the multipart. It must have Content-Disposition of attributes; name="test_details".It must have Content-Type of application/json.This is a JSON representation of an object with the following structure. |
test_name
|
String |
[Required] Mandatory informational name for the test, set as the TEST_NAME global variable.Typically the filename of the Lua test script (without suffix). This value does not have any correlation with the run_id query parameter.
|
trace_level
|
0 / 1 / 2 / 3
|
Requests a raised trace level for the first execution in the test run.0 = None, 1 = Debug, 2 = Dump, 3 = Spam.The trace level will not be set lower than the LogicApp default trace level.The trace level will not be set above than the LogicApp maximum trace level.(Default = do not raise the first test run instance trace level). |
global_vars
|
Object |
Optional additional values to set as global variables available to the Lua script execution. Each top-level key in the object is used as the name of a global variable set to the indicated value. (Default = do not set any additional global variables). |
initial_args
|
Object |
Free-form arguments structure to be passed to the test. Supplied as the first entry in the ... varargs to the main Lua script.(Default = empty object). |
distribution
|
Object |
Used to request load-testing (execution of more than one test instance within the run). (Default = use single distribution type).
|
.type
|
single / load / linear
|
single execute one instance only for the test.linear execute total at cps bounded by backlogload execute total instances bounded by backlog(Default = single).
|
.total
|
Integer |
Total number of Test Instances to execute. Not used for type = single.
|
.ramp
|
Float |
Initial period (in seconds) before cps or backlog is reached.Not used for type = single.
|
.cps
|
Float |
Target rate of Test Instances started per second. Used only for type = linear.
|
.backlog
|
Integer |
Maximum backlog of Test Instances in progress. Not used for type = single.
|
lua_chunk
|
String/Bytes |
[Required] The Lua chunk is a mandatory element in the multipart. It must have Content-Disposition of script; name="lua_chunk".It must have Content-Type of application/lua.This is a Lua chunk which will be called as the main method. It may be compiled or uncompiled. |
(require-libs)
|
String/Bytes |
None or more side-loaded require libraries may be included in the StartRun request. Each must have Content-Disposition of require; name="path.to.lib".It must have Content-Type of application/lua.Each is a Lua chunk which can be loaded using require "path.to.lib". It may be compiled or uncompiled.(Default = no side-loaded require libraries). |
The REST response in the case of success is a 200 status code with application/json content type.
The JSON object represented in the content body is:
| Field | Type | Description |
|---|---|---|
success
|
1
|
This indicates success. |