userver: components::TestsuiteSupport Class Reference
Loading...
Searching...
No Matches
components::TestsuiteSupport Class Referencefinal

#include <userver/testsuite/testsuite_support.hpp>

Detailed Description

Testsuite support component.

Provides additional functionality for testing, e.g. forced cache updates.

Static options of components::TestsuiteSupport :

Name Description Default value
testsuite-periodic-update-enabled Whether caches update periodically. true
testsuite-periodic-dumps-enabled Whether dumpable components write dumps periodically. true
testsuite-pg-execute-timeout Execute timeout override for postgres.
testsuite-pg-statement-timeout Statement timeout override for postgres.
testsuite-pg-readonly-master-expected Mutes readonly master detection warning. false
testsuite-redis-timeout-connect Minimum connection timeout for redis.
testsuite-redis-timeout-single Minimum single shard timeout for redis.
testsuite-redis-timeout-all Minimum command timeout for redis.
testsuite-grpc-is-tls-enabled Whether TLS should be enabled.
testsuite-grpc-client-timeout-ms Forced timeout on client requests.
testsuite-tasks-enabled Weather or not testsuite tasks are enabled. false
testsuite-increased-timeout Increase timeouts in testing environments. Overrides postgres, redis and grpc timeouts if these are missing. 0ms
cache-update-execution If 'sequential' the caches are updated by testsuite sequentially in the order for cache component registration, which makes sense if service has components that push value into a cache component. If 'concurrent' the caches are updated concurrently with respect to the cache component dependencies. Possible values: concurrent, sequential. concurrent

Options inherited from components::ComponentBase :

Name Description Default value
load-enabled Set to false to disable loading of the component. true

Static configuration example:

# yaml
testsuite-support:
testsuite-periodic-update-enabled: true
testsuite-pg-execute-timeout: 300ms
testsuite-pg-statement-timeout: 300ms
testsuite-pg-readonly-master-expected: false
testsuite-redis-timeout-connect: 5s
testsuite-redis-timeout-single: 1s
testsuite-redis-timeout-all: 750ms
testsuite-increased-timeout: 40s
cache-update-execution: concurrent
Examples
postgresql/functional_tests/basic_chaos/postgres_service.cpp, samples/grpc_service/main.cpp, samples/http_caching/main.cpp, samples/kafka_service/main.cpp, and samples/postgres_service/main.cpp.

Definition at line 40 of file testsuite_support.hpp.

+ Inheritance diagram for components::TestsuiteSupport:

Public Member Functions

 TestsuiteSupport (const components::ComponentConfig &component_config, const components::ComponentContext &component_context)
 
testsuite::CacheControlGetCacheControl ()
 
testsuite::DumpControlGetDumpControl ()
 
testsuite::PeriodicTaskControlGetPeriodicTaskControl ()
 
testsuite::TestpointControlGetTestpointControl ()
 
const testsuite::PostgresControlGetPostgresControl ()
 
const testsuite::RedisControlGetRedisControl ()
 
testsuite::TestsuiteTasksGetTestsuiteTasks ()
 
testsuite::HttpAllowedUrlsExtraGetHttpAllowedUrlsExtra ()
 
testsuite::GrpcControlGetGrpcControl ()
 
std::chrono::milliseconds GetIncreasedTimeout () const noexcept
 
virtual ComponentHealth GetComponentHealth () const
 
virtual void OnLoadingCancelled ()
 
virtual void OnAllComponentsLoaded ()
 

Static Public Member Functions

static yaml_config::Schema GetStaticConfigSchema ()
 

Static Public Attributes

static constexpr std::string_view kName = "testsuite-support"
 The default name of components::TestsuiteSupport.
 

Member Function Documentation

◆ GetComponentHealth()

virtual ComponentHealth components::RawComponentBase::GetComponentHealth ( ) const
inlinevirtualinherited

Reimplemented in components::ComponentBase, and server::handlers::Restart.

Definition at line 49 of file raw_component_base.hpp.

◆ GetIncreasedTimeout()

std::chrono::milliseconds components::TestsuiteSupport::GetIncreasedTimeout ( ) const
noexcept
Returns
0 if timeout was not increased via testsuite-increased-timeout static option, testsuite-increased-timeout value otherwise

◆ OnAllComponentsLoaded()

virtual void components::RawComponentBase::OnAllComponentsLoaded ( )
inlinevirtualinherited

◆ OnLoadingCancelled()

virtual void components::RawComponentBase::OnLoadingCancelled ( )
inlinevirtualinherited

Reimplemented in components::ComponentBase.

Definition at line 51 of file raw_component_base.hpp.


The documentation for this class was generated from the following file: