Documentation ¶
Overview ¶
package picker provided structures and method to manage injected variable system for Godog.
It allows an user to pick value into a store and inject them in steps through a variable replacement.
Index ¶
- Variables
- func Debug() error
- func NoLog()
- func Reset() error
- func ResetLog()
- type Fixtures
- func (fix Fixtures) LoadData(fixturePath string) (err error)
- func (fix Fixtures) LoadFromInstance(fixturePath string, instanceKey string) error
- func (fix Fixtures) LoadFromTags(tags []*messages.Pickle_PickleTag) error
- func (fix Fixtures) LoadGooglePubsub(gcp, fixturePath string) error
- func (fix Fixtures) LoadPostgres(db, fixturePath string) error
- func (fix Fixtures) LoadYAMLManifest(manifestPath string) (err error)
- func (fix Fixtures) NewTagLoader(s *godog.Scenario)
- func (fix Fixtures) Reset()
- func (fix *Fixtures) WithBasePath(path string) *Fixtures
- type Kind
- type Manifest
- type WithInstanceManifest
- type WithKindManifest
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidInstance indicates that an object instance was expected but // did not matched expected types. ErrInvalidInstance = errors.New("invalid picked instance") // ErrUnknown indicates that on object should be available but // was not stored. ErrUnknown = errors.New("unknown instance") // ErrUnsupportedFixture indicates provided fixture kind // is not supported. ErrUnsupportedFixture = errors.New("unsupported fixture kind") )
Functions ¶
Types ¶
type Fixtures ¶
type Fixtures struct {
// contains filtered or unexported fields
}
Fixtures manages fixtures files to help data initialisation for test.
It relies on picker.Picker manager.
func (Fixtures) LoadFromInstance ¶
func (Fixtures) LoadFromTags ¶
func (Fixtures) LoadGooglePubsub ¶
LoadGooglePubsub applies yaml pubsub manifest seed fixtures to picked google instance name.
func (Fixtures) LoadPostgres ¶
LoadPostgres applies sql seed fixtures to picked database name.
func (Fixtures) LoadYAMLManifest ¶
LoadYAMLManifest loads Manifest from path
func (Fixtures) NewTagLoader ¶
NewTagLoader initializes tag parsing process to load Manifest from `@manifest` tag.
func (*Fixtures) WithBasePath ¶
WithBasePath add a path element as prefix for any fixture file path.
type Kind ¶
type Kind int
Kind of the loaded fixtures.
const ( // Variables indicates fixtures to load data // using store. Variables Kind = iota + 1 // Postgres indicates fixtures to load SQL // data for a picked postgres db instance. Postgres // Pubsub indicates fixtures to load PUBSUB // events for a picked pubsub instance. Pubsub // API indicates fixtures to load API // definitions background data. API )
type Manifest ¶
type Manifest struct { Variables []string `yaml:"variables"` API []*WithInstanceManifest `yaml:"api"` Pubsub []*WithKindManifest `yaml:"pubsub"` Database []*WithKindManifest `yaml:"database"` }
Manifest represents a YAML fixture manifest.
type WithInstanceManifest ¶
type WithInstanceManifest struct { Path string `yaml:"path"` Instance string `yaml:"pickedInstanceKey"` }
WithInstanceManifest represents a manifest part witch link a fixture file to a specific instance.
type WithKindManifest ¶
type WithKindManifest struct { Kind string `yaml:"kind"` Path string `yaml:"path"` Instance string `yaml:"pickedInstanceKey"` }
WithKindManifest represents manifest part providing fixtures requiring an instance kind.