mocks

package
v0.169.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeArtifactDownloader added in v0.99.2

type FakeArtifactDownloader struct {
	DownloadArtifactFn func(jobID, suiteName string) []string
}

FakeArtifactDownloader defines a fake Downloader

func (*FakeArtifactDownloader) DownloadArtifact added in v0.99.2

func (f *FakeArtifactDownloader) DownloadArtifact(jobID, suiteName string, realDevice bool) []string

DownloadArtifact defines a fake function for FakeDownloader

type FakeArtifactService added in v0.118.0

type FakeArtifactService struct {
}

FakeArtifactService is the mocked struct

func (*FakeArtifactService) Download added in v0.118.0

func (s *FakeArtifactService) Download(jobID, filename string, isRDC bool) ([]byte, error)

Download does download specified artifact

func (*FakeArtifactService) List added in v0.118.0

func (s *FakeArtifactService) List(jobID string, isRDC bool) (artifacts.List, error)

List returns artifact list

func (*FakeArtifactService) Upload added in v0.118.0

func (s *FakeArtifactService) Upload(jobID, filename string, isRDC bool, content []byte) error

Upload does upload specified artifact

type FakeBuildReader added in v0.123.0

type FakeBuildReader struct {
	GetBuildIDFn func(ctx context.Context, jobID string, buildSource build.Source) (string, error)
}

FakeBuildReader mocks build.Reader

func (*FakeBuildReader) GetBuildID added in v0.123.0

func (f *FakeBuildReader) GetBuildID(ctx context.Context, jobID string, buildSource build.Source) (string, error)

type FakeDevicesReader added in v0.49.0

type FakeDevicesReader struct {
	GetDevicesFn func(context.Context, string) ([]devices.Device, error)
}

FakeDevicesReader is a mock for the devices.Reader interface.

func (*FakeDevicesReader) GetDevices added in v0.49.0

func (fdr *FakeDevicesReader) GetDevices(ctx context.Context, OS string) ([]devices.Device, error)

GetDevices is a wrapper around GetDevicesFn.

type FakeEmulatorsReader added in v0.49.0

type FakeEmulatorsReader struct {
	GetVirtualDevicesFn func(context.Context, string) ([]vmd.VirtualDevice, error)
}

FakeEmulatorsReader is a mock for the vmd.Reader interface.

func (*FakeEmulatorsReader) GetVirtualDevices added in v0.49.0

func (fer *FakeEmulatorsReader) GetVirtualDevices(ctx context.Context, kind string) ([]vmd.VirtualDevice, error)

GetVirtualDevices is a wrapper around GetVirtualDevicesFn.

type FakeFrameworkInfoReader added in v0.49.0

type FakeFrameworkInfoReader struct {
	FrameworksFn func(ctx context.Context) ([]string, error)
	VersionsFn   func(ctx context.Context, frameworkName string) ([]framework.Metadata, error)
}

FakeFrameworkInfoReader is a mock for the interface framework.MetadataService.

func (*FakeFrameworkInfoReader) Frameworks added in v0.49.0

func (fir *FakeFrameworkInfoReader) Frameworks(ctx context.Context) ([]string, error)

Frameworks is a wrapper around FrameworksFn.

func (*FakeFrameworkInfoReader) Versions added in v0.49.0

func (fir *FakeFrameworkInfoReader) Versions(ctx context.Context, frameworkName string) ([]framework.Metadata, error)

Versions is a wrapper around VersionsFn.

type FakeInsightService added in v0.119.0

type FakeInsightService struct {
	GetHistoryFn  func(context.Context, iam.User, config.LaunchOrder) (insights.JobHistory, error)
	PostTestRunFn func(context.Context, []insights.TestRun) error
	ListJobsFn    func(ctx context.Context, userID, jobType string, queryOption job.QueryOption) (job.List, error)
	ReadJobFn     func(ctx context.Context, id string) (job.Job, error)
}

func (FakeInsightService) GetHistory added in v0.119.0

func (FakeInsightService) ListJobs added in v0.120.0

func (f FakeInsightService) ListJobs(ctx context.Context, userID, jobType string, queryOption job.QueryOption) (job.List, error)

func (FakeInsightService) PostTestRun added in v0.119.0

func (f FakeInsightService) PostTestRun(ctx context.Context, runs []insights.TestRun) error

func (FakeInsightService) ReadJob added in v0.120.0

func (f FakeInsightService) ReadJob(ctx context.Context, id string) (job.Job, error)

type FakeJobReader

type FakeJobReader struct {
	ReadJobFn                func(ctx context.Context, id string) (job.Job, error)
	PollJobFn                func(ctx context.Context, id string, interval time.Duration, timeout time.Duration) (job.Job, error)
	GetJobAssetFileNamesFn   func(ctx context.Context, jobID string) ([]string, error)
	GetJobAssetFileContentFn func(ctx context.Context, jobID, fileName string) ([]byte, error)
}

FakeJobReader resto mock

func (*FakeJobReader) GetJobAssetFileContent

func (fjr *FakeJobReader) GetJobAssetFileContent(ctx context.Context, jobID, fileName string, realDevice bool) ([]byte, error)

GetJobAssetFileContent mock function

func (*FakeJobReader) GetJobAssetFileNames added in v0.37.0

func (fjr *FakeJobReader) GetJobAssetFileNames(ctx context.Context, jobID string, realDevice bool) ([]string, error)

GetJobAssetFileNames mock function

func (*FakeJobReader) PollJob

func (fjr *FakeJobReader) PollJob(ctx context.Context, id string, interval, timeout time.Duration, realDevice bool) (job.Job, error)

PollJob mock function

func (*FakeJobReader) ReadJob

func (fjr *FakeJobReader) ReadJob(ctx context.Context, id string, realDevice bool) (job.Job, error)

ReadJob mock function

type FakeJobStarter

type FakeJobStarter struct {
	StartJobFn func(ctx context.Context, opts job.StartOptions) (jobID string, isRDC bool, err error)
}

FakeJobStarter resto mock

func (*FakeJobStarter) StartJob

func (fjs *FakeJobStarter) StartJob(ctx context.Context, opts job.StartOptions) (jobID string, isRDC bool, err error)

StartJob mock function

type FakeJobStopper added in v0.35.0

type FakeJobStopper struct {
	StopJobFn func(ctx context.Context, jobID string) (job.Job, error)
}

FakeJobStopper resto mock

func (*FakeJobStopper) StopJob added in v0.35.0

func (fjs *FakeJobStopper) StopJob(ctx context.Context, jobID string, realDevice bool) (job.Job, error)

StopJob mock function

type FakeJobWriter added in v0.37.1

type FakeJobWriter struct {
	UploadAssetFn func(jobID string, fileName string, contentType string, content []byte) error
}

FakeJobWriter resto mock

func (*FakeJobWriter) UploadAsset added in v0.37.1

func (fjw *FakeJobWriter) UploadAsset(jobID string, realDevice bool, fileName string, contentType string, content []byte) error

UploadAsset mock function

type FakeProjectUploader

type FakeProjectUploader struct {
	UploadSuccess bool
}

FakeProjectUploader mock struct

func (*FakeProjectUploader) Download added in v0.107.0

func (fpu *FakeProjectUploader) Download(id string) (io.ReadCloser, int64, error)

func (*FakeProjectUploader) Find added in v0.46.0

func (fpu *FakeProjectUploader) Find(hash string) (storage.Item, error)

Find mock function

func (*FakeProjectUploader) List added in v0.107.0

func (*FakeProjectUploader) Upload

func (fpu *FakeProjectUploader) Upload(name, description string) (storage.Item, error)

Upload mock function

func (*FakeProjectUploader) UploadStream added in v0.107.0

func (fpu *FakeProjectUploader) UploadStream(filename, description string, reader io.Reader) (storage.Item, error)

type TestRunner added in v0.26.0

type TestRunner struct {
	HasProject  bool
	HasSetup    bool
	HasRun      bool
	HasFinished bool
}

TestRunner is a mock to test runner functionalities

func (*TestRunner) Run added in v0.26.0

func (r *TestRunner) Run() (int, error)

Run test

func (*TestRunner) RunProject added in v0.26.0

func (r *TestRunner) RunProject() (int, error)

RunProject pretends to run tests defined by config.Project.

func (*TestRunner) Setup added in v0.26.0

func (r *TestRunner) Setup() error

Setup testrun

func (*TestRunner) Teardown added in v0.26.0

func (r *TestRunner) Teardown(logDir string) error

Teardown test run

type UserService added in v0.126.0

type UserService struct {
	UserFn        func(ctx context.Context) (iam.User, error)
	ConcurrencyFn func(ctx context.Context) (iam.Concurrency, error)
}

func (*UserService) Concurrency added in v0.126.0

func (s *UserService) Concurrency(ctx context.Context) (iam.Concurrency, error)

func (*UserService) User added in v0.126.0

func (s *UserService) User(ctx context.Context) (iam.User, error)

Jump to

Keyboard shortcuts

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