Documentation
¶
Index ¶
- Constants
- Variables
- func ArrayToPool(array []string)
- func GenerateDBAuthor() db.AuthorDB
- func GetTestAssets() embed.FS
- type TestContainerConfiguration
- type TestDBHandler
- func (test *TestDBHandler) AddTests(testConfs ...TestRunConfig)
- func (test *TestDBHandler) InitMySQL() *db.MysqlDB
- func (test *TestDBHandler) InitPostgres() *db.PostgresDB
- func (test *TestDBHandler) StartTestDBHandler()
- func (test *TestDBHandler) TestRun(t *testing.T, testRun TestRunConfig, newDS func() db.DataStore)
- type TestDataStore
- type TestRunConfig
Constants ¶
View Source
const ( DbName = "test_db" DbUser = "test_user" DbPass = "test_password" )
Variables ¶
View Source
var TestAssets embed.FS
Functions ¶
func ArrayToPool ¶
func ArrayToPool(array []string)
func GenerateDBAuthor ¶
func GetTestAssets ¶
Types ¶
type TestContainerConfiguration ¶
type TestContainerConfiguration struct {
Container *testcontainers.DockerContainer
Host string
Port string
Username string
Password string
Database string
}
func PrepareMySQLDB ¶
func PrepareMySQLDB() (*TestContainerConfiguration, error)
func PreparePostgresDB ¶
func PreparePostgresDB() (*TestContainerConfiguration, error)
type TestDBHandler ¶
type TestDBHandler struct {
// contains filtered or unexported fields
}
func NewTestDBHandler ¶
func NewTestDBHandler(t *testing.T) *TestDBHandler
func (*TestDBHandler) AddTests ¶
func (test *TestDBHandler) AddTests(testConfs ...TestRunConfig)
func (*TestDBHandler) InitMySQL ¶
func (test *TestDBHandler) InitMySQL() *db.MysqlDB
func (*TestDBHandler) InitPostgres ¶
func (test *TestDBHandler) InitPostgres() *db.PostgresDB
func (*TestDBHandler) StartTestDBHandler ¶
func (test *TestDBHandler) StartTestDBHandler()
func (*TestDBHandler) TestRun ¶
func (test *TestDBHandler) TestRun( t *testing.T, testRun TestRunConfig, newDS func() db.DataStore, )
type TestDataStore ¶
type TestDataStore struct {
DS db.DataStore
Logger *zap.SugaredLogger
Hooks *hooks2.Hook
ReadOnlyManager *pad.ReadOnlyManager
SecurityManager *pad.SecurityManager
AuthorManager *author.Manager
PadManager *pad.Manager
PadMessageHandler *ws.PadMessageHandler
AdminMessageHandler *ws.AdminMessageHandler
MockWebSocket *ws.MockWebSocketConn
Validator *validator.Validate
Hub *ws.Hub
App *fiber.App
PrivateAPI fiber.Router
}
func (*TestDataStore) ToInitStore ¶
func (t *TestDataStore) ToInitStore() *lib.InitStore
type TestRunConfig ¶
type TestRunConfig struct {
Name string
Test func(t *testing.T, tsStore TestDataStore)
}
Click to show internal directories.
Click to hide internal directories.