Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IntegrationTest ¶
func IntegrationTest(t *testing.T, providerCreator func() *provider.Provider, resource ResourceIntegrationTestData)
IntegrationTest - creates resources using terraform, fetches them to db and compares with expected values
func TestResource ¶
func TestResource(t *testing.T, providerCreator func() *provider.Provider, resource ResourceTestData)
Types ¶
type ExpectedValue ¶
type ExpectedValue struct { Count int // expected count of items Data map[string]interface{} // expected data of items }
ExpectedValue - describes the data that expected to be in database after fetch
type ResourceIntegrationTestData ¶
type ResourceIntegrationTestData struct { Table *schema.Table Config interface{} Resources []string Configure func(logger hclog.Logger, data interface{}) (schema.ClientMeta, error) Suffix string Prefix string VerificationBuilder func(res *ResourceIntegrationTestData) ResourceIntegrationVerification // contains filtered or unexported fields }
type ResourceIntegrationVerification ¶
type ResourceIntegrationVerification struct { Name string ForeignKeyName string ExpectedValues []ExpectedValue Filter func(sq squirrel.SelectBuilder, res *ResourceIntegrationTestData) squirrel.SelectBuilder Relations []*ResourceIntegrationVerification }
ResourceIntegrationVerification - a set of verification rules to query and check test related data
type ResourceTestData ¶
Click to show internal directories.
Click to hide internal directories.