tests

package
v4.0.0-...-3ebc7ba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDebugInterceptorLog

func FormatDebugInterceptorLog(value interface{}) (string, bool)

Types

type DebugInterceptorLog

type DebugInterceptorLog struct {
	LogPath string
}

DebugInterceptorLog encapsulates the gRPC debug log file produced by the PULUMI_DEBUG_GRPC environment variable.

func NewDebugInterceptorLog

func NewDebugInterceptorLog(t *testing.T) (*DebugInterceptorLog, error)

func (*DebugInterceptorLog) Close

func (d *DebugInterceptorLog) Close() error

func (*DebugInterceptorLog) Env

func (d *DebugInterceptorLog) Env() string

func (*DebugInterceptorLog) ReadAll

func (*DebugInterceptorLog) Reset

func (d *DebugInterceptorLog) Reset() error

type DebugInterceptorLogEntry

type DebugInterceptorLogEntry struct {
	Method   string          `json:"method"`
	Request  json.RawMessage `json:"request,omitempty"`
	Response json.RawMessage `json:"response,omitempty"`
	Errors   []string        `json:"errors,omitempty"`
	Metadata interface{}     `json:"metadata,omitempty"`
}

JSON format for tracking gRPC conversations. Normal methods have one entry for each req-resp conversation, streaming methods have one entry per each request or response over the stream.

func ReadDebugInterceptorLogFile

func ReadDebugInterceptorLogFile(name string) ([]DebugInterceptorLogEntry, error)

ReadDebugInterceptorLogFile parses the gRPC log file produced by the PULUMI_DEBUG_GRPC environment variable.

type DebugInterceptorLogEntryList

type DebugInterceptorLogEntryList []DebugInterceptorLogEntry

func (DebugInterceptorLogEntryList) Invokes

Invokes lists the Invoke calls in the log.

func (DebugInterceptorLogEntryList) ListRegisterResource

func (l DebugInterceptorLogEntryList) ListRegisterResource() RegisterResourceList

ListRegisterResource lists the RegisterResource calls in the log.

type Invoke

type Invoke struct {
	Request  pulumirpc.ResourceInvokeRequest
	Response pulumirpc.InvokeResponse
	Errors   []string    `json:"errors,omitempty"`
	Metadata interface{} `json:"metadata,omitempty"`
}

Invoke is a decoded "/pulumirpc.ResourceMonitor/Invoke" RPC call.

func ParseInvoke

func ParseInvoke(entry DebugInterceptorLogEntry) (*Invoke, bool)

ParseInvoke parses a log entry as a Invoke call.

type InvokeList

type InvokeList []Invoke

func (InvokeList) ByProvider

func (l InvokeList) ByProvider(providerUrn resource.URN) InvokeList

Lookup returns Invoke entries matching the given provider and token (operation).

func (InvokeList) Tok

func (l InvokeList) Tok(tok string) InvokeList

Lookup returns Invoke entries matching the given token (operation).

type RegisterResource

type RegisterResource struct {
	Request  pulumirpc.RegisterResourceRequest
	Response pulumirpc.RegisterResourceResponse
	Errors   []string    `json:"errors,omitempty"`
	Metadata interface{} `json:"metadata,omitempty"`
}

RegisterResource is a decoded "/pulumirpc.ResourceMonitor/RegisterResource" RPC call.

func ParseRegisterResource

func ParseRegisterResource(entry DebugInterceptorLogEntry) (*RegisterResource, bool)

ParseRegisterResource parses a log entry as a RegisterResource call.

type RegisterResourceList

type RegisterResourceList []RegisterResource

func (RegisterResourceList) Named

Named returns RegisterResource entries matching the given resource type, name, and parent.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL