Documentation ¶
Index ¶
Constants ¶
const DefaultResourceName = "test"
DefaultResourceName is exported to allow assertions against the resources using the default name.
Variables ¶
This section is empty.
Functions ¶
func FromModel ¶
func FromModel(t *testing.T, model ResourceModel) string
FromModel should be used in terraform acceptance tests for Config attribute to get string config from ResourceModel. Current implementation is really straightforward but it could be improved and tested. It may not handle all cases (like objects, lists, sets) correctly. TODO [SNOW-1501905]: use reflection to build config directly from model struct (or some other different way) TODO [SNOW-1501905]: add support for config.TestStepConfigFunc (to use as ConfigFile); the naive implementation would be to just create a tmp directory and save file there
Types ¶
type ResourceModel ¶
type ResourceModel interface { Resource() resources.Resource ResourceName() string SetResourceName(name string) }
ResourceModel is the base interface all of our config models will implement. To allow easy implementation, ResourceModelMeta can be embedded inside the struct (and the struct will automatically implement it).
type ResourceModelMeta ¶
type ResourceModelMeta struct {
// contains filtered or unexported fields
}
func DefaultMeta ¶
func DefaultMeta(resource resources.Resource) *ResourceModelMeta
func (*ResourceModelMeta) Resource ¶
func (m *ResourceModelMeta) Resource() resources.Resource
func (*ResourceModelMeta) ResourceName ¶
func (m *ResourceModelMeta) ResourceName() string
func (*ResourceModelMeta) SetResourceName ¶
func (m *ResourceModelMeta) SetResourceName(name string)