Documentation ¶
Index ¶
- Constants
- type TestContext
- func (t *TestContext) Cleanup()
- func (t *TestContext) CreateDB(dbName string) int
- func (t *TestContext) DefaultDbId(idParts ...any) string
- func (t *TestContext) ExecDB(dbName string, statFmt string, args ...any)
- func (t *TestContext) ExecDefaultDB(statFmt string, args ...any)
- func (t *TestContext) ExecMasterDB(statFmt string, args ...any)
- func (t *TestContext) FormatId(idParts ...any) string
- func (t *TestContext) GetDBConnection(dbName string) *sql.DB
- func (t *TestContext) GetDefaultDBConnection() *sql.DB
- func (t *TestContext) GetMasterDBConnection() *sql.DB
- func (t *TestContext) NewProviderFactories() map[string]func() (tfprotov6.ProviderServer, error)
- func (t *TestContext) Run(name string, test func(testCtx *TestContext)) *TestContext
- func (t *TestContext) SqlCheck(dbName string, check func(conn *sql.DB) error) resource.TestCheckFunc
- func (t *TestContext) SqlCheckDefaultDB(check func(conn *sql.DB) error) resource.TestCheckFunc
- func (t *TestContext) SqlCheckMaster(check func(conn *sql.DB) error) resource.TestCheckFunc
- func (t *TestContext) Test(testCase resource.TestCase)
Constants ¶
View Source
const DefaultDbName = "acc-test-db"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestContext ¶
type TestContext struct { Require *require.Assertions Assert *assert.Assertions IsAzureTest bool IsAcceptanceTest bool DefaultDBId int AzureADTestGroup struct { Id string Name string } AzureTestMSI struct { Name string ObjectId string ClientId string } // contains filtered or unexported fields }
func NewContext ¶
func NewContext(t *testing.T, providerFactory func(connection sql2.Connection) provider.Provider) *TestContext
func (*TestContext) Cleanup ¶
func (t *TestContext) Cleanup()
func (*TestContext) CreateDB ¶
func (t *TestContext) CreateDB(dbName string) int
func (*TestContext) DefaultDbId ¶ added in v0.4.0
func (t *TestContext) DefaultDbId(idParts ...any) string
func (*TestContext) ExecDB ¶
func (t *TestContext) ExecDB(dbName string, statFmt string, args ...any)
func (*TestContext) ExecDefaultDB ¶
func (t *TestContext) ExecDefaultDB(statFmt string, args ...any)
func (*TestContext) ExecMasterDB ¶
func (t *TestContext) ExecMasterDB(statFmt string, args ...any)
func (*TestContext) FormatId ¶ added in v0.4.0
func (t *TestContext) FormatId(idParts ...any) string
func (*TestContext) GetDBConnection ¶
func (t *TestContext) GetDBConnection(dbName string) *sql.DB
func (*TestContext) GetDefaultDBConnection ¶
func (t *TestContext) GetDefaultDBConnection() *sql.DB
func (*TestContext) GetMasterDBConnection ¶
func (t *TestContext) GetMasterDBConnection() *sql.DB
func (*TestContext) NewProviderFactories ¶
func (t *TestContext) NewProviderFactories() map[string]func() (tfprotov6.ProviderServer, error)
func (*TestContext) Run ¶
func (t *TestContext) Run(name string, test func(testCtx *TestContext)) *TestContext
func (*TestContext) SqlCheck ¶
func (t *TestContext) SqlCheck(dbName string, check func(conn *sql.DB) error) resource.TestCheckFunc
func (*TestContext) SqlCheckDefaultDB ¶
func (t *TestContext) SqlCheckDefaultDB(check func(conn *sql.DB) error) resource.TestCheckFunc
func (*TestContext) SqlCheckMaster ¶
func (t *TestContext) SqlCheckMaster(check func(conn *sql.DB) error) resource.TestCheckFunc
func (*TestContext) Test ¶
func (t *TestContext) Test(testCase resource.TestCase)
Click to show internal directories.
Click to hide internal directories.