Documentation ¶
Overview ¶
Package gormtestsupport provides all the required functions to manage the lifecycle and common operations against our gorm database in tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBTestSuite ¶
type DBTestSuite struct { suite.Suite Configuration *config.ConfigurationData DB *gorm.DB // contains filtered or unexported fields }
DBTestSuite is a base for tests using a gorm db
func NewDBTestSuite ¶
func NewDBTestSuite(configFilePath string) DBTestSuite
NewDBTestSuite instanciate a new DBTestSuite
func (*DBTestSuite) DisableGormCallbacks ¶
func (s *DBTestSuite) DisableGormCallbacks() func()
DisableGormCallbacks will turn off gorm's automatic setting of `created_at` and `updated_at` columns. Call this function and make sure to `defer` the returned function.
resetFn := DisableGormCallbacks() defer resetFn()
func (*DBTestSuite) PopulateDBTestSuite ¶
func (s *DBTestSuite) PopulateDBTestSuite(ctx context.Context)
PopulateDBTestSuite populates the DB with common values
func (*DBTestSuite) SetupSuite ¶
func (s *DBTestSuite) SetupSuite()
SetupSuite implements suite.SetupAllSuite
func (*DBTestSuite) TearDownSuite ¶
func (s *DBTestSuite) TearDownSuite()
TearDownSuite implements suite.TearDownAllSuite
Directories ¶
Path | Synopsis |
---|---|
Package benchmark provides all the required functions to manage the lifecycle and common operations against our gorm database in benchmarks.
|
Package benchmark provides all the required functions to manage the lifecycle and common operations against our gorm database in benchmarks. |
Click to show internal directories.
Click to hide internal directories.