integrationmocks

package
v0.0.0-...-d0ced46 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package integrationmocks exposes endpoints to simplify integration testing.

Exposed endpoints fake some of Swarming Python server logic, which allows running some integration tests entirely within luci-go repo.

Index

Constants

View Source
const (
	IntegrationMocks_GeneratePollToken_FullMethodName = "/swarming.integrationmocks.IntegrationMocks/GeneratePollToken"
)

Variables

View Source
var File_go_chromium_org_luci_swarming_server_testing_integrationmocks_server_proto protoreflect.FileDescriptor
View Source
var IntegrationMocks_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "swarming.integrationmocks.IntegrationMocks",
	HandlerType: (*IntegrationMocksServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GeneratePollToken",
			Handler:    _IntegrationMocks_GeneratePollToken_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "go.chromium.org/luci/swarming/server/testing/integrationmocks/server.proto",
}

IntegrationMocks_ServiceDesc is the grpc.ServiceDesc for IntegrationMocks service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func FileDescriptorSet

func FileDescriptorSet() *descriptorpb.FileDescriptorSet

FileDescriptorSet returns a descriptor set for this proto package, which includes all defined services, and all transitive dependencies.

Will not return nil.

Do NOT modify the returned descriptor.

func RegisterIntegrationMocksServer

func RegisterIntegrationMocksServer(s grpc.ServiceRegistrar, srv IntegrationMocksServer)

Types

type IntegrationMocksClient

type IntegrationMocksClient interface {
	// GeneratePollToken produces a HMAC-tagged poll token.
	GeneratePollToken(ctx context.Context, in *internals.PollState, opts ...grpc.CallOption) (*PollToken, error)
}

IntegrationMocksClient is the client API for IntegrationMocks service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

IntegrationMocks is called by local integration tests as replacement for Swarming Python endpoints.

IntegrationMocks is compiled into the main server binary, but it is exposed only when the CLI flag `-expose-integration-mocks` is set (which happens in integration tests).

type IntegrationMocksServer

type IntegrationMocksServer interface {
	// GeneratePollToken produces a HMAC-tagged poll token.
	GeneratePollToken(context.Context, *internals.PollState) (*PollToken, error)
	// contains filtered or unexported methods
}

IntegrationMocksServer is the server API for IntegrationMocks service. All implementations must embed UnimplementedIntegrationMocksServer for forward compatibility.

IntegrationMocks is called by local integration tests as replacement for Swarming Python endpoints.

IntegrationMocks is compiled into the main server binary, but it is exposed only when the CLI flag `-expose-integration-mocks` is set (which happens in integration tests).

func New

New constructs an IntegrationMocksServer implementation.

type PollToken

type PollToken struct {
	PollToken []byte `protobuf:"bytes,1,opt,name=poll_token,json=pollToken,proto3" json:"poll_token,omitempty"`
	// contains filtered or unexported fields
}

PollToken carries HMAC-tagged poll token, as if it was returned by Swarming Python's "/bot/poll" response.

func (*PollToken) Descriptor deprecated

func (*PollToken) Descriptor() ([]byte, []int)

Deprecated: Use PollToken.ProtoReflect.Descriptor instead.

func (*PollToken) GetPollToken

func (x *PollToken) GetPollToken() []byte

func (*PollToken) ProtoMessage

func (*PollToken) ProtoMessage()

func (*PollToken) ProtoReflect

func (x *PollToken) ProtoReflect() protoreflect.Message

func (*PollToken) Reset

func (x *PollToken) Reset()

func (*PollToken) String

func (x *PollToken) String() string

type UnimplementedIntegrationMocksServer

type UnimplementedIntegrationMocksServer struct{}

UnimplementedIntegrationMocksServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedIntegrationMocksServer) GeneratePollToken

type UnsafeIntegrationMocksServer

type UnsafeIntegrationMocksServer interface {
	// contains filtered or unexported methods
}

UnsafeIntegrationMocksServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to IntegrationMocksServer will result in compilation errors.

Jump to

Keyboard shortcuts

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