Handler that allows to control the behavior of server from tests, and functional tests with testsuite in particular.
It is highly recommended to disable this handle in production via the load-enabled: false option.
The component must be configured in service config.
Static options:
Aside from common handler options component has the following options:
Name | Description | Default value |
testpoint-url | an URL that should be notified in the TESTPOINT_CALLBACK and TESTPOINT_CALLBACK_NONCORO macros | - |
skip-unregistered-testpoints | do not send testpoints data for paths that were not registered by testpoint-url | false |
testpoint-timeout | timeout to use while working with testpoint-url | 1s |
Static configuration example:
# yaml
tests-control:
skip-unregistered-testpoints: true
testpoint-timeout: 10s
testpoint-url: https:
# Some options from server::handlers::HttpHandlerBase
path: /tests/{action}
method: POST
task_processor: main-task-processor
Scheme
Main user of the scheme is the pytest_userver.client.Client python class. In particular:
{
"action": "run_periodic_task" | "suspend_periodic_tasks" | "write_cache_dumps" | "read_cache_dumps" | "metrics_portability"
"testpoints": [<list of testpoints to register>]
"reset_metrics": true | false
"invalidate_caches": <...>
"socket_logging_duplication": true | false
<...>
}
- See also
- Functional service tests (testsuite)
- Examples
- postgresql/functional_tests/basic_chaos/postgres_service.cpp, and samples/tcp_full_duplex_service/tcp_full_duplex_service.cpp.
Definition at line 64 of file tests_control.hpp.