Enhancement for integration test helpers (#1223)

* Add option to run sidecar without app

* Allow specifying custom components path

Co-authored-by: Long Dai <long.dai@intel.com>
This commit is contained in:
Bernd Verst 2021-10-25 15:10:40 -07:00 committed by GitHub
parent 72754c6036
commit 53a04bc120
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -52,6 +52,12 @@ func WithAppProtocol(protocol runtime.Protocol, port int) Option {
}
}
func WithoutApp() Option {
return func(config *runtime.Config) {
config.ApplicationPort = 0
}
}
func WithDaprHTTPPort(port int) Option {
return func(config *runtime.Config) {
config.HTTPPort = port
@ -76,6 +82,12 @@ func WithListenAddresses(addresses []string) Option {
}
}
func WithComponentsPath(path string) Option {
return func(config *runtime.Config) {
config.Standalone.ComponentsPath = path
}
}
func NewRuntime(appID string, opts ...Option) (*runtime.DaprRuntime, error) {
var err error