fakes

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GerritChange

type GerritChange struct {
	*gerrit.ChangeInfo
	GerritChangeEdit
	IsSubmitted bool
}

GerritChange captures information about a single gerrit change created via GerritClient.CreateChange()

type GerritChangeEdit

type GerritChangeEdit struct {
	// Maps file path to new contents of the file.
	Files       map[string]string
	IsPublished bool
	IsAbandoned bool
	Subject     string
}

GerritChangeEdit captures information about a change edit created via GerritClient.ChangeEditFileContent on a ChangeEdit.

type GerritClient

type GerritClient struct {
	Changes []*GerritChange
	// contains filtered or unexported fields
}

GerritClient is a fake implementation of the gitstore.GerritClient interface.

func (*GerritClient) AbandonChange

func (gc *GerritClient) AbandonChange(ctx context.Context, in *gerrit.AbandonChangeRequest, opts ...grpc.CallOption) (*gerrit.ChangeInfo, error)

AbandonChange implements the gerrit.GerritClient interface.

func (*GerritClient) ChangeEditFileContent

func (gc *GerritClient) ChangeEditFileContent(ctx context.Context, in *gerrit.ChangeEditFileContentRequest, opts ...grpc.CallOption) (*empty.Empty, error)

ChangeEditFileContent implements the gerrit.GerritClient interface.

func (*GerritClient) ChangeEditPublish

func (gc *GerritClient) ChangeEditPublish(ctx context.Context, in *gerrit.ChangeEditPublishRequest, opts ...grpc.CallOption) (*empty.Empty, error)

ChangeEditPublish implements the gerrit.GerritClient interface.

func (*GerritClient) CreateChange

func (gc *GerritClient) CreateChange(ctx context.Context, in *gerrit.CreateChangeRequest, opts ...grpc.CallOption) (*gerrit.ChangeInfo, error)

CreateChange implements the gerrit.GerritClient interface.

func (*GerritClient) DeleteEditFileContent

func (gc *GerritClient) DeleteEditFileContent(ctx context.Context, in *gerrit.DeleteEditFileContentRequest, opts ...grpc.CallOption) (*empty.Empty, error)

DeleteEditFileContent implements the gerrit.GerritClient interface.

func (*GerritClient) GetChange

GetChange implements the gerrit.GerritClient interface.

func (*GerritClient) GetMergeable

GetMergeable implements the gerrit.GerritClient interface.

func (*GerritClient) ListChanges

ListChanges that match a query.

Note, although the Gerrit API supports multiple queries, for which it can return multiple lists of changes, this is not a foreseen use-case so this API just includes one query with one returned list of changes.

https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-changes

func (*GerritClient) ListFiles

ListFiles implements the gerrit.GerritClient interface.

func (*GerritClient) SetReview

SetReview implements the gerrit.GerritClient interface.

func (*GerritClient) SubmitChange

func (gc *GerritClient) SubmitChange(ctx context.Context, in *gerrit.SubmitChangeRequest, opts ...grpc.CallOption) (*gerrit.ChangeInfo, error)

SubmitChange implements the gerrit.GerritClient interface.

type GitilesClient

type GitilesClient struct {
	Archived map[string][]byte
}

GitilesClient is a fake implementation of the gitstore.GitilesClient interface.

func NewGitilesClient

func NewGitilesClient() *GitilesClient

NewGitilesClient returns an initialized fake GitilesClient.

func (*GitilesClient) Archive

Archive implements gitiles.GitilesClient interface.

func (*GitilesClient) DownloadFile

DownloadFile implements gitiles.GitilesClient inteface.

func (*GitilesClient) Log

Log implements gitiles.GitilesClient interface.

func (*GitilesClient) Projects

Projects retrieves list of available Gitiles projects

func (*GitilesClient) Refs

Refs implements gitiles.GitilesClient interface.

func (*GitilesClient) SetDeviceConfigs

func (g *GitilesClient) SetDeviceConfigs(ic *config.Inventory, configs []byte) error

SetDeviceConfigs sets the serialized device configs as returned from gitiles.

func (*GitilesClient) SetInventory

func (g *GitilesClient) SetInventory(ic *config.Inventory, data InventoryData) error

SetInventory sets the serialized lab and infrastructure data as the inventory archive returned from gitiles. TODO(xixuan): remove this after per-file inventory is landed and tested.

func (*GitilesClient) SetSplitInventory

func (g *GitilesClient) SetSplitInventory(ic *config.Inventory, data InventoryData) error

SetSplitInventory sets the serialized inventory data for the split inventory (each host has its own inventory file). archive returned from gitiles.

type InventoryData

type InventoryData struct {
	Lab            []byte
	Infrastructure []byte
	// The mapping from the path of the file where the DUT's inventory data is stored (relative the git project root) to its content.
	// E.g. chromeos-misc/jetstream-host.textpb => `duts { common {...} }`
	//
	// This will replace lab field when per-file inventory is enabled. See crbug.com/1008442 for details.
	Duts map[string][]byte
}

InventoryData contains serialized proto files to be returned as part of the gitiles archive.

Jump to

Keyboard shortcuts

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