Commit graph

37 commits

Author SHA1 Message Date
Andrei Zeliankou
c183bd8749 Tests: get rid of classes in test files.
Class usage came from the unittest framework and it was always redundant
after migration to the pytest.  This commit removes classes from files
containing tests to make them more readable and understandable.
2023-06-14 18:20:09 +01:00
Andrei Zeliankou
ce2405ec3d Tests: prerequisites checking reworked.
Prerequisites check moved to the module level to simplify class structure.
Discovery and prerequisites checks functions moved to the separate files.
Introduced "require" fixture to provide per-test requirements check.
2023-06-12 14:16:59 +01:00
Andrei Zeliankou
18fcc07c77 Tests: unified setup method usage.
To make fixtures accessible inside of setup methods in tests all these methods
are renamed to the "setup_method_fixture" and decorated by autouse flag.

Also all setup methods moved to the top of the files.
2023-05-25 16:56:14 +01:00
Andrei Zeliankou
3e4fa1e202 Tests: removed unused variables. 2023-05-25 14:26:12 +01:00
Andrei Zeliankou
7934dcabbc Tests: switched to using f-strings.
Previously, it was necessary to support older versions of Python for
compatibility.  F-strings were released in Python 3.6.  Python 3.5 was
marked as unsupported by the end of 2020, so now it's possible to start
using f-strings safely for better readability and performance.
2023-02-21 17:21:29 +00:00
Max Romanov
506ec2b825 Tests: app prototype related fixes. 2021-11-09 15:48:44 +03:00
Andrei Zeliankou
39adb292d5 Tests: style. 2021-10-18 01:10:11 +01:00
Max Romanov
fa9fb29be2 Application restart introduced.
When processing a restart request, the router sends a QUIT message to all
existing processes of the application.  Then, a new shared application port is
created to ensure that new requests won't be handled by the old processes of
the application.
2021-07-29 19:50:39 +03:00
Andrei Zeliankou
6c97a1a069 Tests: style. 2021-04-05 14:03:05 +01:00
Andrei Zeliankou
d43a84139d Tests: added missing checks for configuration results. 2021-01-14 03:04:20 +00:00
Andrei Zeliankou
6dc9c47ccd Tests: style. 2021-01-13 06:22:43 +00:00
Andrei Zeliankou
07789a23e9 Tests: options moved to the separate class.
This change is necessary to separate the logic
and prevent possible circular dependency.
2020-12-06 16:01:59 +00:00
Andrei Zeliankou
54837759f3 Tests: fixed unit.log print. 2020-10-19 22:25:29 +01:00
Andrei Zeliankou
6ec0ff3596 Tests: minor fixes. 2020-10-07 23:18:43 +01:00
Andrei Zeliankou
d5e9159340 Tests: migrated to the pytest. 2020-09-16 21:31:15 +01:00
Max Romanov
bab4a9e9f2 Tests: skipping idle zero timeout.
This is a temporary solution after the 'shared port' patch.  The application
process becomes idle immediately after creation.  Even if it starts processing
a request (without acknowledging it yet), it is stopped by the router because
an 'out-of-idle-time' event occurs.
2020-08-11 19:20:23 +03:00
Andrei Zeliankou
ce4a2bbd05 Tests: style. 2020-05-15 04:20:56 +01:00
Andrei Zeliankou
6a9a4fe0d4 Tests: introduced module version specification in prerequisites. 2020-04-24 05:08:56 +01:00
Andrei Zeliankou
0bfa09dfa0 Tests: minor fixes and style. 2020-04-14 02:35:04 +01:00
Andrei Zeliankou
93207d4a8c Tests: test_python_procman.py refactored. 2020-03-19 03:17:00 +00:00
Andrey Zelenkov
65ca2d7b19 Tests: refactored prerequisites model. 2019-09-14 14:44:35 +03:00
Andrey Zelenkov
90c5d3f5c0 Tests: adjusted skipping tests. 2019-05-30 16:46:04 +03:00
Andrey Zelenkov
af24e4dec4 Tests: simplified module checking. 2019-04-09 16:14:42 +03:00
Andrey Zelenkov
19eba1730a Tests: unit module refactoring. 2019-03-28 18:43:13 +03:00
Andrey Zelenkov
281899fcef Tests: style. 2019-03-26 23:38:30 +03:00
Andrey Zelenkov
bd77c9a4d2 Tests: read_timeout option introduced.
Also, increased default select() timeout from 1s to 5s.
2019-02-27 19:43:14 +03:00
Andrey Zelenkov
eff760bd2b Tests: added command line arguments parsing in tests.
Added the following command line arguments:

  -d, --detailed: Show detailed output for tests

    Usage examples:

    ./test/run.py --detailed
    python3 test/test_access_log.py --detailed
    python3 test/test_access_log.py -d TestUnitAccessLog.test_access_log_ipv6


  -l, --log: Save unit.log after the test execution

    Usage examples:

    ./test/run.py -l
    python3 test/test_access_log.py -l
    python3 test/test_access_log.py --log TestUnitAccessLog.test_access_log_ipv6
2018-11-15 21:26:15 +03:00
Andrey Zelenkov
511a0fa760 Tests: used relative path for configuration. 2018-09-06 20:18:33 +03:00
Andrey Zelenkov
6aa00fa8d0 Tests: more configuration tests. 2018-02-26 20:18:24 +03:00
Andrey Zelenkov
09f2009df5 Tests: reworked python tests with application. 2018-02-20 20:34:41 +03:00
Andrey Zelenkov
ee39da0e00 Tests: removed unused code in unit.py. 2018-02-14 17:14:16 +03:00
Andrey Zelenkov
b4e467e669 Fixed configuration checks for "max" property. 2018-02-06 20:31:48 +03:00
Andrey Zelenkov
5c35d30cc8 Tests: more tests for processes. 2018-02-06 20:31:48 +03:00
Andrey Zelenkov
993f8f2d5c Tests: changed process counting in test_python_procman.py. 2018-02-06 20:31:42 +03:00
Andrey Zelenkov
ff9fa11cd9 Tests: minor fixes in test_python_procman.py. 2018-02-06 20:17:09 +03:00
Andrey Zelenkov
3faa154223 Tests: adjusted check_version()'s. 2018-02-05 15:39:11 +03:00
Max Romanov
9cd4fdbdb7 Introducing extended app process management.
- Pre-fork 'processes.spare' application processes;
- fork more processes to keep 'processes.spare' idle processes;
- fork on-demand up to 'processes.max' count;
- scale down idle application processes above 'processes.spare' after
  'processes.idle_timeout';
- number of concurrently started application processes also limited by
  'processes.spare' (or 1, if spare is 0).
2018-01-29 16:17:36 +03:00