forked from avocado-framework/avocado
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Doc] Avocado instrumented lifecycle
This commit adds a new chapter to the reference guide about avocado instrumented tests and its lifecycle. Reference: avocado-framework#5995 Signed-off-by: Jan Richter <[email protected]>
- Loading branch information
Showing
2 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
101 changes: 101 additions & 0 deletions
101
docs/source/guides/reference/chapters/avocado_instrumented.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
|
||
The Avocado instrumented lifecycle | ||
================================== | ||
|
||
The Avocado instrumented test goes through multiple phases during | ||
its execution. This page describes in detail each of those phases | ||
and overall lifecycle of instrumented test execution. | ||
|
||
INIT: | ||
This is the initialization state of test. Each test is | ||
created in this state. During the initialization, the test | ||
attributes are set, environment variables are created, and test | ||
skip conditions are evaluated. | ||
|
||
SETUP: | ||
The test is in this state when Test.setUp() method is being | ||
executed. | ||
|
||
TEST: | ||
During this state, the actual test is running. | ||
|
||
TEARDOWN: | ||
During this state, the Test.tearDown() method is being | ||
executed to make clean up after testing. | ||
|
||
FINISHED: | ||
This state is the end of the test's lifecycle, and the test | ||
is in this state when the testing and clean up is finished. | ||
during this phase, the test results are reported to runner and | ||
the testing is finished. | ||
|
||
The whole Test lifecycle is represented by diagram:: | ||
|
||
+--------+ | ||
| | | ||
| INIT +------------+ | ||
| | | | ||
+----+---+ | | ||
| | | ||
| | | ||
Test|initialized | | ||
| | | ||
| Test|skiped | ||
+----v----+ | | ||
| | | | ||
| SETUP +-----------+---+ | ||
| | | | | ||
+----+----+ | | | ||
| | | | ||
| | | | ||
Test|setuped | | | ||
| | | | ||
| | | | ||
+----v---+ | | | ||
| | | | | ||
+-----------+ TEST <------------+ | | ||
| | | | | ||
| +----+---+ Setup|timeout | ||
| | | | ||
| Test finished or timeout | | ||
| | | | ||
| | | | ||
| +------v-----+ | | ||
| | | | | ||
Test|skiped | TEARDOWN <--------------+ | ||
| | | | ||
| +------+-----+ | ||
| | | ||
| | | ||
| Teardown finished or timeout | ||
| | | ||
| | | ||
| +------v-----+ | ||
| | | | ||
+---------> FINISHED | | ||
| | | ||
+------------+ | ||
|
||
Timeouts | ||
~~~~~~~~ | ||
|
||
The avocado instrumented tests can be affected by three types of | ||
timeouts. Test timeout, Task timeout and Job timeout. All of these | ||
timeouts behaves the same from the point of view of Test’s lifecycle, | ||
but the lifecycle will change base on in which state the timeout was | ||
reached. Here is a description of different Test’s lifecycles base | ||
on the interruptions: | ||
|
||
Timeout in SETUP | ||
INIT -> SETUP(interrupted) -> TEARDOWN -> FINISHED (ERROR) | ||
|
||
Timeout in TEST | ||
INIT -> SETUP -> TEST(interrupted) -> TEARDOWN -> FINISHED (INTERRUPTED) | ||
|
||
Timeout in TEARDOWN | ||
INIT -> SETUP -> TEST -> TEARDOWN(interrupted) -> FINISHED (ERROR) | ||
|
||
.. note:: If Task or Job timeout are reached after some other | ||
interruption (test or task timeouts) the test is killed in | ||
the phase where it is (probably TEARDOWN), and it won’t properly | ||
finish. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ the core parts. | |
:maxdepth: 2 | ||
|
||
chapters/runners | ||
chapters/avocado_instrumented |