mocks

package
v0.0.0-...-03d6fc4 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2019 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHTTPClient

func GetHTTPClient(t assert.TestingT) *http.Client

GetHTTPClient returns a http client either from locally loading a config file or by querying meta data in the cloud.

func GetTileBuilderFromEnv

func GetTileBuilderFromEnv(t assert.TestingT, ctx context.Context) tracedb.MasterTileBuilder

GetTileBuilderFromEnv looks at the TEST_TRACEDB_ADDRESS environement variable for the name of directory that contains tiles. If it's defined it will return a TileStore instance. If the not the calling test will fail.

func MockUrlGenerator

func MockUrlGenerator(path string) string

Mock the url generator function.

func NewMockDiffStore

func NewMockDiffStore() diff.DiffStore

func NewMockTileBuilder

func NewMockTileBuilder(t assert.TestingT, digests [][]string, params []map[string]string, commits []*tiling.Commit) tracedb.MasterTileBuilder

Mock the tilestore for GoldenTraces

func NewMockTileBuilderFromJson

func NewMockTileBuilderFromJson(t assert.TestingT, fname string) tracedb.MasterTileBuilder

NewMockTileStoreFromJson reads a tile that has been serialized to JSON and wraps an instance of MockTileStore around it.

func NewMockTileBuilderFromTile

func NewMockTileBuilderFromTile(t assert.TestingT, tile *tiling.Tile) tracedb.MasterTileBuilder

Mock the tilestore for GoldenTraces

func TraceKey

func TraceKey(params map[string]string) string

TraceKey returns the trace key used in MockTileStore generated from the params map.

Types

type MockDiffStore

type MockDiffStore struct{}

Mock the diffstore.

func (MockDiffStore) Get

func (m MockDiffStore) Get(priority int64, dMain string, dRest []string) (map[string]interface{}, error)

func (MockDiffStore) ImageHandler

func (m MockDiffStore) ImageHandler(urlPrefix string) (http.Handler, error)

func (MockDiffStore) PurgeDigests

func (m MockDiffStore) PurgeDigests(digests []string, purgeGCS bool) error

func (MockDiffStore) UnavailableDigests

func (m MockDiffStore) UnavailableDigests() map[string]*diff.DigestFailure

func (MockDiffStore) WarmDiffs

func (m MockDiffStore) WarmDiffs(priority int64, leftDigests []string, rightDigests []string)

func (MockDiffStore) WarmDigests

func (m MockDiffStore) WarmDigests(priority int64, digests []string, sync bool)

type MockDigestStore

type MockDigestStore struct {
	IssueIDs  []int
	FirstSeen int64
	OkValue   bool
}

func (*MockDigestStore) Get

func (m *MockDigestStore) Get(testName, digest string) (*digeststore.DigestInfo, bool, error)

func (*MockDigestStore) Update

type MockTileBuilder

type MockTileBuilder struct {
	// contains filtered or unexported fields
}

func (*MockTileBuilder) GetTile

func (m *MockTileBuilder) GetTile() *tiling.Tile

Jump to

Keyboard shortcuts

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