Documentation ¶
Overview ¶
Package testlib exposes helper methods for running unit tests against a containerized test store.
Index ¶
- func AssertLog(t *testing.T, logs *bytes.Buffer, level, message string)
- func AssertNoLog(t *testing.T, logs *bytes.Buffer, level, message string)
- func GetMockStoreForSetupFunctions() *mocks.Store
- func SetupTestResources() (string, error)
- type FakeClusterInterface
- func (c *FakeClusterInterface) ClearMessages()
- func (c *FakeClusterInterface) ConfigChanged(previousConfig *model.Config, newConfig *model.Config, sendToOtherServer bool) *model.AppError
- func (c *FakeClusterInterface) GetClusterId() string
- func (c *FakeClusterInterface) GetClusterInfos() []*model.ClusterInfo
- func (c *FakeClusterInterface) GetClusterStats() ([]*model.ClusterStats, *model.AppError)
- func (c *FakeClusterInterface) GetLogs(page, perPage int) ([]string, *model.AppError)
- func (c *FakeClusterInterface) GetMessages() []*model.ClusterMessage
- func (c *FakeClusterInterface) GetMyClusterInfo() *model.ClusterInfo
- func (c *FakeClusterInterface) GetPluginStatuses() (model.PluginStatuses, *model.AppError)
- func (c *FakeClusterInterface) IsLeader() bool
- func (c *FakeClusterInterface) NotifyMsg(buf []byte)
- func (c *FakeClusterInterface) RegisterClusterMessageHandler(event string, crm einterfaces.ClusterMessageHandler)
- func (c *FakeClusterInterface) SendClearRoleCacheMessage()
- func (c *FakeClusterInterface) SendClusterMessage(message *model.ClusterMessage)
- func (c *FakeClusterInterface) StartInterNodeCommunication()
- func (c *FakeClusterInterface) StopInterNodeCommunication()
- type HelperOptions
- type MainHelper
- func (h *MainHelper) Close() error
- func (h *MainHelper) GetClusterInterface() *FakeClusterInterface
- func (h *MainHelper) GetSQLSettings() *model.SqlSettings
- func (h *MainHelper) GetSQLSupplier() *sqlstore.SqlSupplier
- func (h *MainHelper) GetSearchEngine() *searchengine.Broker
- func (h *MainHelper) GetStore() store.Store
- func (h *MainHelper) Main(m *testing.M)
- type TestStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertLog ¶ added in v5.22.0
AssertLog asserts that a JSON-encoded buffer of logs contains one with the given level and message.
func AssertNoLog ¶ added in v5.23.0
AssertNoLog asserts that a JSON-encoded buffer of logs does not contains one with the given level and message.
func GetMockStoreForSetupFunctions ¶ added in v5.22.0
func SetupTestResources ¶
Types ¶
type FakeClusterInterface ¶
type FakeClusterInterface struct {
// contains filtered or unexported fields
}
func (*FakeClusterInterface) ClearMessages ¶
func (c *FakeClusterInterface) ClearMessages()
func (*FakeClusterInterface) ConfigChanged ¶
func (*FakeClusterInterface) GetClusterId ¶
func (c *FakeClusterInterface) GetClusterId() string
func (*FakeClusterInterface) GetClusterInfos ¶
func (c *FakeClusterInterface) GetClusterInfos() []*model.ClusterInfo
func (*FakeClusterInterface) GetClusterStats ¶
func (c *FakeClusterInterface) GetClusterStats() ([]*model.ClusterStats, *model.AppError)
func (*FakeClusterInterface) GetLogs ¶
func (c *FakeClusterInterface) GetLogs(page, perPage int) ([]string, *model.AppError)
func (*FakeClusterInterface) GetMessages ¶
func (c *FakeClusterInterface) GetMessages() []*model.ClusterMessage
func (*FakeClusterInterface) GetMyClusterInfo ¶
func (c *FakeClusterInterface) GetMyClusterInfo() *model.ClusterInfo
func (*FakeClusterInterface) GetPluginStatuses ¶
func (c *FakeClusterInterface) GetPluginStatuses() (model.PluginStatuses, *model.AppError)
func (*FakeClusterInterface) IsLeader ¶
func (c *FakeClusterInterface) IsLeader() bool
func (*FakeClusterInterface) NotifyMsg ¶
func (c *FakeClusterInterface) NotifyMsg(buf []byte)
func (*FakeClusterInterface) RegisterClusterMessageHandler ¶
func (c *FakeClusterInterface) RegisterClusterMessageHandler(event string, crm einterfaces.ClusterMessageHandler)
func (*FakeClusterInterface) SendClearRoleCacheMessage ¶
func (c *FakeClusterInterface) SendClearRoleCacheMessage()
func (*FakeClusterInterface) SendClusterMessage ¶
func (c *FakeClusterInterface) SendClusterMessage(message *model.ClusterMessage)
func (*FakeClusterInterface) StartInterNodeCommunication ¶
func (c *FakeClusterInterface) StartInterNodeCommunication()
func (*FakeClusterInterface) StopInterNodeCommunication ¶
func (c *FakeClusterInterface) StopInterNodeCommunication()
type HelperOptions ¶
type MainHelper ¶
type MainHelper struct { Settings *model.SqlSettings Store store.Store SearchEngine *searchengine.Broker SQLSupplier *sqlstore.SqlSupplier ClusterInterface *FakeClusterInterface // contains filtered or unexported fields }
func NewMainHelper ¶
func NewMainHelper() *MainHelper
func NewMainHelperWithOptions ¶
func NewMainHelperWithOptions(options *HelperOptions) *MainHelper
func (*MainHelper) Close ¶
func (h *MainHelper) Close() error
func (*MainHelper) GetClusterInterface ¶
func (h *MainHelper) GetClusterInterface() *FakeClusterInterface
func (*MainHelper) GetSQLSettings ¶ added in v5.22.0
func (h *MainHelper) GetSQLSettings() *model.SqlSettings
func (*MainHelper) GetSQLSupplier ¶ added in v5.22.0
func (h *MainHelper) GetSQLSupplier() *sqlstore.SqlSupplier
func (*MainHelper) GetSearchEngine ¶ added in v5.24.0
func (h *MainHelper) GetSearchEngine() *searchengine.Broker
func (*MainHelper) GetStore ¶
func (h *MainHelper) GetStore() store.Store
func (*MainHelper) Main ¶
func (h *MainHelper) Main(m *testing.M)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.