Documentation ¶
Index ¶
- Variables
- func MockRoutingV2(t *testing.T, cnt int32) []*apitraffic.RouteRule
- func RespSuccess(resp api.ResponseMessage) bool
- func SetTestDataClean(callback func() TestDataClean)
- type Bootstrap
- type DiscoverTestSuit
- func (d *DiscoverTestSuit) BatchController() *batch.Controller
- func (d *DiscoverTestSuit) CacheMgr() *cache.CacheManager
- func (d *DiscoverTestSuit) CleanAllService()
- func (d *DiscoverTestSuit) CleanCircuitBreaker(id, version string)
- func (d *DiscoverTestSuit) CleanCircuitBreakerRelation(name, namespace, ruleID, ruleVersion string)
- func (d *DiscoverTestSuit) CleanCommonRoutingConfig(service string, namespace string)
- func (d *DiscoverTestSuit) CleanCommonRoutingConfigV2(rules []*apitraffic.RouteRule)
- func (d *DiscoverTestSuit) CleanInstance(instanceID string)
- func (d *DiscoverTestSuit) CleanNamespace(name string)
- func (d *DiscoverTestSuit) CleanRateLimit(id string)
- func (d *DiscoverTestSuit) CleanReportClient()
- func (d *DiscoverTestSuit) CleanService(name, namespace string)
- func (d *DiscoverTestSuit) CleanServiceContract() error
- func (d *DiscoverTestSuit) CleanServices(services []*apiservice.Service)
- func (d *DiscoverTestSuit) ClearTestDataWhenUseRDS() error
- func (d *DiscoverTestSuit) ConfigServer() config.ConfigCenterServer
- func (d *DiscoverTestSuit) Destroy()
- func (d *DiscoverTestSuit) DiscoverServer() service.DiscoverServer
- func (d *DiscoverTestSuit) GetBootstrapConfig() *TestConfig
- func (d *DiscoverTestSuit) GetTestDataClean() TestDataClean
- func (d *DiscoverTestSuit) HealthCheckServer() *healthcheck.Server
- func (d *DiscoverTestSuit) Initialize(opts ...options) error
- func (d *DiscoverTestSuit) InjectSuit(*DiscoverTestSuit)
- func (d *DiscoverTestSuit) NamespaceServer() ns.NamespaceOperateServer
- func (d *DiscoverTestSuit) OriginConfigServer() *config.Server
- func (d *DiscoverTestSuit) OriginDiscoverServer() service.DiscoverServer
- func (d *DiscoverTestSuit) ReplaceStore(caller func() store.Store)
- func (d *DiscoverTestSuit) StrategyServer() auth.StrategyServer
- func (d *DiscoverTestSuit) TruncateCommonRoutingConfigV2()
- func (d *DiscoverTestSuit) UpdateCacheInterval() time.Duration
- func (d *DiscoverTestSuit) UserServer() auth.UserServer
- type TestConfig
- type TestDataClean
Constants ¶
This section is empty.
Variables ¶
View Source
var InjectTestDataClean func() TestDataClean
Functions ¶
func MockRoutingV2 ¶ added in v1.16.0
func MockRoutingV2(t *testing.T, cnt int32) []*apitraffic.RouteRule
func SetTestDataClean ¶ added in v1.17.3
func SetTestDataClean(callback func() TestDataClean)
Types ¶
type DiscoverTestSuit ¶
type DiscoverTestSuit struct { DefaultCtx context.Context Storage store.Store // contains filtered or unexported fields }
func (*DiscoverTestSuit) BatchController ¶ added in v1.17.2
func (d *DiscoverTestSuit) BatchController() *batch.Controller
func (*DiscoverTestSuit) CacheMgr ¶ added in v1.17.3
func (d *DiscoverTestSuit) CacheMgr() *cache.CacheManager
func (*DiscoverTestSuit) CleanAllService ¶ added in v1.17.3
func (d *DiscoverTestSuit) CleanAllService()
从数据库彻底删除全部服务
func (*DiscoverTestSuit) CleanCircuitBreaker ¶ added in v1.17.3
func (d *DiscoverTestSuit) CleanCircuitBreaker(id, version string)
彻底删除熔断规则
func (*DiscoverTestSuit) CleanCircuitBreakerRelation ¶ added in v1.17.3
func (d *DiscoverTestSuit) CleanCircuitBreakerRelation(name, namespace, ruleID, ruleVersion string)
彻底删除熔断规则发布记录
func (*DiscoverTestSuit) CleanCommonRoutingConfig ¶ added in v1.17.3
func (d *DiscoverTestSuit) CleanCommonRoutingConfig(service string, namespace string)
彻底删除一个路由配置
func (*DiscoverTestSuit) CleanCommonRoutingConfigV2 ¶ added in v1.17.3
func (d *DiscoverTestSuit) CleanCommonRoutingConfigV2(rules []*apitraffic.RouteRule)
彻底删除一个路由配置
func (*DiscoverTestSuit) CleanInstance ¶ added in v1.17.3
func (d *DiscoverTestSuit) CleanInstance(instanceID string)
从数据库彻底删除实例
func (*DiscoverTestSuit) CleanNamespace ¶ added in v1.17.3
func (d *DiscoverTestSuit) CleanNamespace(name string)
从数据库彻底删除命名空间
func (*DiscoverTestSuit) CleanRateLimit ¶ added in v1.17.3
func (d *DiscoverTestSuit) CleanRateLimit(id string)
彻底删除限流规则
func (*DiscoverTestSuit) CleanReportClient ¶ added in v1.17.3
func (d *DiscoverTestSuit) CleanReportClient()
func (*DiscoverTestSuit) CleanService ¶ added in v1.17.3
func (d *DiscoverTestSuit) CleanService(name, namespace string)
从数据库彻底删除服务
func (*DiscoverTestSuit) CleanServiceContract ¶ added in v1.18.0
func (d *DiscoverTestSuit) CleanServiceContract() error
彻底删除熔断规则发布记录
func (*DiscoverTestSuit) CleanServices ¶ added in v1.17.3
func (d *DiscoverTestSuit) CleanServices(services []*apiservice.Service)
clean services
func (*DiscoverTestSuit) ClearTestDataWhenUseRDS ¶ added in v1.17.3
func (d *DiscoverTestSuit) ClearTestDataWhenUseRDS() error
func (*DiscoverTestSuit) ConfigServer ¶ added in v1.17.3
func (d *DiscoverTestSuit) ConfigServer() config.ConfigCenterServer
func (*DiscoverTestSuit) Destroy ¶
func (d *DiscoverTestSuit) Destroy()
func (*DiscoverTestSuit) DiscoverServer ¶
func (d *DiscoverTestSuit) DiscoverServer() service.DiscoverServer
func (*DiscoverTestSuit) GetBootstrapConfig ¶ added in v1.18.0
func (d *DiscoverTestSuit) GetBootstrapConfig() *TestConfig
func (*DiscoverTestSuit) GetTestDataClean ¶ added in v1.17.3
func (d *DiscoverTestSuit) GetTestDataClean() TestDataClean
func (*DiscoverTestSuit) HealthCheckServer ¶
func (d *DiscoverTestSuit) HealthCheckServer() *healthcheck.Server
func (*DiscoverTestSuit) Initialize ¶
func (d *DiscoverTestSuit) Initialize(opts ...options) error
func (*DiscoverTestSuit) InjectSuit ¶ added in v1.17.3
func (d *DiscoverTestSuit) InjectSuit(*DiscoverTestSuit)
func (*DiscoverTestSuit) NamespaceServer ¶
func (d *DiscoverTestSuit) NamespaceServer() ns.NamespaceOperateServer
func (*DiscoverTestSuit) OriginConfigServer ¶ added in v1.17.3
func (d *DiscoverTestSuit) OriginConfigServer() *config.Server
func (*DiscoverTestSuit) OriginDiscoverServer ¶
func (d *DiscoverTestSuit) OriginDiscoverServer() service.DiscoverServer
func (*DiscoverTestSuit) ReplaceStore ¶ added in v1.17.3
func (d *DiscoverTestSuit) ReplaceStore(caller func() store.Store)
func (*DiscoverTestSuit) StrategyServer ¶ added in v1.17.3
func (d *DiscoverTestSuit) StrategyServer() auth.StrategyServer
func (*DiscoverTestSuit) TruncateCommonRoutingConfigV2 ¶ added in v1.17.3
func (d *DiscoverTestSuit) TruncateCommonRoutingConfigV2()
func (*DiscoverTestSuit) UpdateCacheInterval ¶
func (d *DiscoverTestSuit) UpdateCacheInterval() time.Duration
func (*DiscoverTestSuit) UserServer ¶ added in v1.17.3
func (d *DiscoverTestSuit) UserServer() auth.UserServer
type TestConfig ¶
type TestConfig struct { Bootstrap Bootstrap `yaml:"bootstrap"` Cache cache.Config `yaml:"cache"` Namespace ns.Config `yaml:"namespace"` Naming service.Config `yaml:"naming"` DisableConfig bool Config config.Config `yaml:"config"` HealthChecks healthcheck.Config `yaml:"healthcheck"` Store store.Config `yaml:"store"` DisableAuth bool Auth auth.Config `yaml:"auth"` Plugin plugin.Config `yaml:"plugin"` ReplaceStore store.Store ServiceCacheEntries []cachetypes.ConfigEntry }
type TestDataClean ¶ added in v1.17.3
type TestDataClean interface { InjectSuit(*DiscoverTestSuit) // CleanNamespace CleanNamespace(name string) // CleanReportClient CleanReportClient() // CleanAllService CleanAllService() // CleanService CleanService(name, namespace string) // CleanServices CleanServices(services []*apiservice.Service) // CleanInstance CleanInstance(instanceID string) // CleanCommonRoutingConfig CleanCommonRoutingConfig(service string, namespace string) // TruncateCommonRoutingConfigV2 TruncateCommonRoutingConfigV2() // CleanCommonRoutingConfigV2 CleanCommonRoutingConfigV2(rules []*apitraffic.RouteRule) // CleanRateLimit CleanRateLimit(id string) // CleanCircuitBreaker CleanCircuitBreaker(id, version string) // CleanCircuitBreakerRelation CleanCircuitBreakerRelation(name, namespace, ruleID, ruleVersion string) // ClearTestDataWhenUseRDS ClearTestDataWhenUseRDS() error // CleanServiceContract CleanServiceContract() error }
TestDataClean 测试套件数据清理
Click to show internal directories.
Click to hide internal directories.