acctest

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL