testclients

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: MPL-2.0-no-copyleft-exception Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataClient

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

DataClient is the datasvc client

func NewDataClient

func NewDataClient() (*DataClient, error)

NewDataClient returns a new datasvc client with window dressings for tests.

func (*DataClient) Client

func (dc *DataClient) Client() *data.Client

Client returns the underlying client.

func (*DataClient) MakeQueueItem

func (dc *DataClient) MakeQueueItem() (*model.QueueItem, error)

MakeQueueItem returns a queueitem that has already been stored

func (*DataClient) MakeRepo

func (dc *DataClient) MakeRepo(fullRepo, owner string, private bool, forkOf string) error

MakeRepo saves a repo with name, owner, and private state.

func (*DataClient) MakeUser

func (dc *DataClient) MakeUser(username string) (*model.User, error)

MakeUser makes a new user with the name provided. It is given a dummy access token.

type QueueClient

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

QueueClient is the queuesvc client

func NewQueueClient

func NewQueueClient(dc *DataClient) (*QueueClient, error)

NewQueueClient returns a new queuesvc client with window dressings for tests.

func (*QueueClient) Client

func (qc *QueueClient) Client() *queue.Client

Client returns the underlying client.

func (*QueueClient) GetYAMLs added in v0.3.0

func (qc *QueueClient) GetYAMLs(pathadd string) ([]byte, []byte, error)

GetYAMLs finds the test yamls needed to run the tests.

func (*QueueClient) SetMockSubmissionOnFork

func (qc *QueueClient) SetMockSubmissionOnFork(mock *github.MockClientMockRecorder, sub *types.Submission, parent, resolvedSHA, pathadd string) error

SetMockSubmissionOnFork sets mock submissions for fork-only repositories. Used in a few tests.

func (*QueueClient) SetMockSubmissionSuccess

func (qc *QueueClient) SetMockSubmissionSuccess(mock *github.MockClientMockRecorder, sub *types.Submission, forkBranch string, pathadd string) error

SetMockSubmissionSuccess creates all the mock tooling necessary to set up a submission

func (*QueueClient) SetUpSubmissionRepo

func (qc *QueueClient) SetUpSubmissionRepo(name string, forkOf string) error

SetUpSubmissionRepo takes a name of a repo; and configures the submission repo and a user belonging to it. Returns the name of the owner and any error.

Jump to

Keyboard shortcuts

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