Test engine¶
The scheduler¶
Programming of performances¶
- The scheduler present in the server makes it possible to program the execution of the tests in several ways.
- Run the test once in
x_seconds
ordate_time
- Run the test several times at date_time.
- Run the test at each
start time
atfinish time
- Run the test every hour at a specific
hour
- Run the test every day at a precise
hour
- Run the test once a week the
day of the week
at a specifichour
- Run the test once in
Note
A recursive task will be automatically restarted by the server after a reboot.
Task Management¶
- The following actions are available to manage tasks scheduled by users:
- cancel one or more tasks
- stop one or more tasks
- reprogram one or more tasks
- view the history of the performances.
All of its actions can be done from the heavy client or from the API.
Parallelized executions¶
It is possible to run multiple tests in parallel using the Grouped
function
This function is available from the heavy client or from the API.
- There are 2 options of executions:
- run tests one after the other (no link)
- or parallel execution
Note
From the API, use the function /rest/tests/schedule/group
.
{
"test": [
"Common:/Samples/Tests_Unit/02_A.tux",
"Common:/Samples/Tests_Unit/03_B.tux"
],
"postpone-at": [],
"parallel-mode": False,
"postpone-mode": False
}
Important
There is no guarantee that the tests will start at the same time with this mode of execution.
Synchronized executions¶
Sharing adapters¶
The `` shared mode`` feature allows you to reuse the same adapter in several test cases. This mode is to be used in a scenario (test plan) or a test suite with several test cases.
- Here is an example of possible use:
- the scenario tests an application
- in the background, the scenario also checks the logs generated by the application
- It is therefore possible to influence the result of the test based on what is found in the logs.
To enable shared mode, set the `` shared`` parameter to True and give the adapter a name:
self.ADP_EXAMPLE = SutAdapters.Dummy.Adapter(
parent=self,
debug=False,
name="MY_ADAPTER",
shared=True
)
Note
It is important to give a name to its adapter because it makes finding it easier. If no name is given, the framework configures the adapter with a random name.
After initialization of the adapter it is possible to recover an adapter from another test case by searching for it by name.
self.ADP_EXAMPLE = self.findAdapter(name="MY_ADAPTER")
if self.ADP_EXAMPLE is None: Test(self).interrupt("unable to find the adapter")
Sharing data¶
Since the cache is unique when a test (no matter the type) is performed, it is possible to exchange data between several test cases.
A first test can record data in the cache and a 2nd test can retrieve the value stored by the 1st test.
Synchronization¶
Synchronized execution of several test cases is possible using a testplan. This scenario should contain:
- an observer test case
- one or more test cases running actions in the background
The observer test must be used to make the connection between the different adapters.
Important
The use of adapters in shared mode is mandatory.
Note
An example is available in the /Samples/Tests_Non_Sequential
test samples.
Distributed executions¶
The solution allows for distributed executions using distributed agents across the networks.