Documentation ¶
Index ¶
- type Option
- func AttachDownloadedPlugin(name, version string) Option
- func AttachProvider(name string, startProvider providers.ProviderFactory) Option
- func AttachProviderBinary(name, path string) Option
- func AttachProviderServer(name string, startProvider providers.ResourceProviderServerFactory) Option
- func ConfigPassphrase(passphrase string) Option
- func Defaults() Option
- func DisableGrpcLog() Option
- func DownloadProviderVersion(name, version string) Option
- func Env(key, value string) Option
- func GoModReplacement(packageSpecifier string, replacementPathElem ...string) Option
- func LocalProviderPath(name string, path ...string) Option
- func NewStackOptions(opts ...optnewstack.NewStackOpt) Option
- func SkipInstall() Option
- func SkipStackCreate() Option
- func StackName(name string) Option
- func TestInPlace() Option
- func UseAmbientBackend() Option
- func WorkspaceOptions(opts ...auto.LocalWorkspaceOption) Option
- func YarnLink(packages ...string) Option
- type Options
- type ProviderConfigUnion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option interface {
Apply(*Options)
}
func AttachDownloadedPlugin ¶
AttachDownloadedPlugin installs the plugin via `pulumi plugin install` then will start the provider and attach it for the test run.
func AttachProvider ¶
func AttachProvider(name string, startProvider providers.ProviderFactory) Option
AttachProvider will start the provider via the specified factory and attach it when running the program under test.
func AttachProviderBinary ¶
AttachProviderBinary adds a provider to be started and attached for the test run. Path can be a directory or a binary. If it is a directory, the binary will be assumed to be pulumi-resource-<name> in that directory.
func AttachProviderServer ¶
func AttachProviderServer(name string, startProvider providers.ResourceProviderServerFactory) Option
AttachProviderServer will start the specified and attach for the test run.
func ConfigPassphrase ¶
SetConfigPassword sets the config passphrase to use when running the program under test.
func Defaults ¶ added in v0.0.6
func Defaults() Option
Defaults sets all options back to their defaults. This can be useful when using CopyToTempDir or Convert but not wanting to inherit any options from the previous PulumiTest.
func DisableGrpcLog ¶ added in v0.0.6
func DisableGrpcLog() Option
DisableGrpcLog disables the gRPC log which is written to grpc.log in the current working directory.
func DownloadProviderVersion ¶ added in v0.0.6
func GoModReplacement ¶
GoModReplacement specifies replacements to be add to the go.mod file when running the program under test. Each replacement is added to the go.mod file with `go mod edit -replace <replacement>` on stack creation.
func LocalProviderPath ¶
LocalProviderPath sets the path to the local provider binary to use when running the program under test. This sets the `plugins.providers` property in the project settings (Pulumi.yaml).
func NewStackOptions ¶ added in v0.0.7
func NewStackOptions(opts ...optnewstack.NewStackOpt) Option
func SkipInstall ¶ added in v0.0.6
func SkipInstall() Option
SkipInstall skips running `pulumi install` before running the program under test.
func SkipStackCreate ¶ added in v0.0.6
func SkipStackCreate() Option
SkipStackCreate skips creating the stack before running the program under test. A stack will have to be created manually before running the program under test.
func StackName ¶ added in v0.0.6
StackName sets the default stack name to use when running the program under test.
func TestInPlace ¶
func TestInPlace() Option
TestInPlace will run the program under test from its current location, rather than firstly copying to a temporary directory.
func UseAmbientBackend ¶
func UseAmbientBackend() Option
UseAmbientBackend skips setting `PULUMI_BACKEND_URL` to a local temporary directory which overrides any backend configuration which might have been done on the local environment via `pulumi login`. Using this option will cause the program under test to use whatever backend configuration has been set via `pulumi login` or an existing `PULUMI_BACKEND_URL` value.
func WorkspaceOptions ¶
func WorkspaceOptions(opts ...auto.LocalWorkspaceOption) Option
WorkspaceOptions sets additional options to pass to the workspace when running the program under test.
type Options ¶
type Options struct { StackName string SkipInstall bool SkipStackCreate bool NewStackOpts []optnewstack.NewStackOpt TestInPlace bool ConfigPassphrase string Providers map[providers.ProviderName]ProviderConfigUnion UseAmbientBackend bool YarnLinks []string GoModReplacements map[string]string CustomEnv map[string]string ExtraWorkspaceOptions []auto.LocalWorkspaceOption DisableGrpcLog bool }
func DefaultOptions ¶
func DefaultOptions() *Options
func (*Options) ProviderFactories ¶
func (o *Options) ProviderFactories() map[providers.ProviderName]providers.ProviderFactory
func (*Options) ProviderPluginPaths ¶
func (o *Options) ProviderPluginPaths() map[providers.ProviderName]string
type ProviderConfigUnion ¶ added in v0.0.6
type ProviderConfigUnion struct { Factory providers.ProviderFactory Path string }
ProviderConfigUnion is a union type for specifying a provider configuration. Only one of Factory or Path should be set.