testutil

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2018 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildServerHack

func BuildServerHack(t *testing.T)

BuildServerHack will check the environment for a variable $BUILDSERVERHACK, will skip if it does not exist

func CompareAllCredWrappers

func CompareAllCredWrappers(allWrapA *pb.AllCredsWrapper, allWrapB *pb.AllCredsWrapper) bool

func CompareCredWrappers

func CompareCredWrappers(credWrapA *pb.CredWrapper, credWrapB *pb.CredWrapper) bool

func CompareRepoCredWrappers

func CompareRepoCredWrappers(repoWrapA *pb.RepoCredWrapper, repoWrapB *pb.RepoCredWrapper) bool

func CreateDoThingsWebServer

func CreateDoThingsWebServer(tarLoc string, port string)

func DockerCreate

func DockerCreate(t *testing.T, ctx context.Context, imageName string, ports []string, mounts ...string) (isRunning bool, cleanup func())

i used all the damn functions that docker is using WHY

func DockerCreateExec

func DockerCreateExec(t *testing.T, ctx context.Context, imageName string, ports []string, mounts ...string) (cleanup func(), err error)

DockerCreateExec creates a docker container by running the docker client via the os/exec package. It will return a cleanup function that will kill the container.

func InitServerAndConsulet

func InitServerAndConsulet(t *testing.T) (*consulet.Consulet, *testutil.TestServer)

func NewFakeBuildClient

func NewFakeBuildClient(logLines []string) *fakeBuildClient

func NewFakeGuideOcelotLogsCli

func NewFakeGuideOcelotLogsCli(lines []string) *fakeGuideOcelotLogsClient

func NewTestBuildRuntime

func NewTestBuildRuntime(done bool, ip string, grpcPort string, logLines []string) *testBuildRuntime

func TarTemplates

func TarTemplates(t *testing.T, tarLoc, relativeTemplateLoc string) func(t *testing.T)

Types

type FakeGuideOcelotClient

type FakeGuideOcelotClient struct {
	pb.GuideOcelotClient

	Generics    *pb.GenericWrap
	ReturnError bool

	Exists bool

	NotConnected bool
	// contains filtered or unexported fields
}

func NewFakeGuideOcelotClient

func NewFakeGuideOcelotClient(logLines []string) *FakeGuideOcelotClient

func (*FakeGuideOcelotClient) AppleCredExists

func (f *FakeGuideOcelotClient) AppleCredExists(ctx context.Context, in *pb.AppleCreds, opts ...grpc.CallOption) (*pb.Exists, error)

func (*FakeGuideOcelotClient) BuildRepoAndHash

func (*FakeGuideOcelotClient) BuildRuntime

func (f *FakeGuideOcelotClient) BuildRuntime(ctx context.Context, in *pb.BuildQuery, opts ...grpc.CallOption) (*pb.Builds, error)

func (*FakeGuideOcelotClient) CheckConn

func (f *FakeGuideOcelotClient) CheckConn(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error)

func (*FakeGuideOcelotClient) DeletePollRepo

func (f *FakeGuideOcelotClient) DeletePollRepo(ctx context.Context, poll *pb.PollRequest, opts ...grpc.CallOption) (*empty.Empty, error)

func (*FakeGuideOcelotClient) FindWerker

func (f *FakeGuideOcelotClient) FindWerker(ctx context.Context, in *pb.BuildReq, opts ...grpc.CallOption) (*pb.BuildRuntimeInfo, error)

func (*FakeGuideOcelotClient) GenericCredExists

func (f *FakeGuideOcelotClient) GenericCredExists(ctx context.Context, in *pb.GenericCreds, opts ...grpc.CallOption) (*pb.Exists, error)

func (*FakeGuideOcelotClient) GetAllCreds

func (f *FakeGuideOcelotClient) GetAllCreds(ctx context.Context, msg *empty.Empty, opts ...grpc.CallOption) (*pb.AllCredsWrapper, error)

func (*FakeGuideOcelotClient) GetAppleCred

func (f *FakeGuideOcelotClient) GetAppleCred(ctx context.Context, in *pb.AppleCreds, opts ...grpc.CallOption) (*pb.AppleCreds, error)

func (*FakeGuideOcelotClient) GetAppleCreds

func (f *FakeGuideOcelotClient) GetAppleCreds(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*pb.AppleCredsWrapper, error)

func (*FakeGuideOcelotClient) GetGenericCreds

func (f *FakeGuideOcelotClient) GetGenericCreds(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*pb.GenericWrap, error)

func (*FakeGuideOcelotClient) GetK8SCred

func (f *FakeGuideOcelotClient) GetK8SCred(ctx context.Context, in *pb.K8SCreds, opts ...grpc.CallOption) (*pb.K8SCreds, error)

func (*FakeGuideOcelotClient) GetK8SCreds

func (f *FakeGuideOcelotClient) GetK8SCreds(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*pb.K8SCredsWrapper, error)

func (*FakeGuideOcelotClient) GetNotifyCred

func (f *FakeGuideOcelotClient) GetNotifyCred(ctx context.Context, in *pb.NotifyCreds, opts ...grpc.CallOption) (*pb.NotifyCreds, error)

func (*FakeGuideOcelotClient) GetNotifyCreds

func (f *FakeGuideOcelotClient) GetNotifyCreds(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*pb.NotifyWrap, error)

func (*FakeGuideOcelotClient) GetRepoCred

func (f *FakeGuideOcelotClient) GetRepoCred(ctx context.Context, in *pb.RepoCreds, opts ...grpc.CallOption) (*pb.RepoCreds, error)

func (*FakeGuideOcelotClient) GetRepoCreds

func (f *FakeGuideOcelotClient) GetRepoCreds(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*pb.RepoCredWrapper, error)

func (*FakeGuideOcelotClient) GetSSHCred

func (*FakeGuideOcelotClient) GetSSHCreds

func (f *FakeGuideOcelotClient) GetSSHCreds(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*pb.SSHWrap, error)

func (*FakeGuideOcelotClient) GetStatus

func (g *FakeGuideOcelotClient) GetStatus(ctx context.Context, query *pb.StatusQuery, opts ...grpc.CallOption) (*pb.Status, error)

func (*FakeGuideOcelotClient) GetTrackedRepos

func (f *FakeGuideOcelotClient) GetTrackedRepos(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*pb.AcctRepos, error)

func (*FakeGuideOcelotClient) GetVCSCred

func (f *FakeGuideOcelotClient) GetVCSCred(ctx context.Context, in *pb.VCSCreds, opts ...grpc.CallOption) (*pb.VCSCreds, error)

func (*FakeGuideOcelotClient) GetVCSCreds

func (f *FakeGuideOcelotClient) GetVCSCreds(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*pb.CredWrapper, error)

func (*FakeGuideOcelotClient) K8SCredExists

func (f *FakeGuideOcelotClient) K8SCredExists(ctx context.Context, in *pb.K8SCreds, opts ...grpc.CallOption) (*pb.Exists, error)

func (*FakeGuideOcelotClient) LastFewSummaries

func (f *FakeGuideOcelotClient) LastFewSummaries(ctx context.Context, in *pb.RepoAccount, opts ...grpc.CallOption) (*pb.Summaries, error)

todo: implement for testing

func (*FakeGuideOcelotClient) ListPolledRepos

func (f *FakeGuideOcelotClient) ListPolledRepos(ctx context.Context, empti *empty.Empty, opts ...grpc.CallOption) (*pb.Polls, error)

func (*FakeGuideOcelotClient) Logs

todo: make this useful

func (*FakeGuideOcelotClient) NotifyCredExists

func (f *FakeGuideOcelotClient) NotifyCredExists(ctx context.Context, in *pb.NotifyCreds, opts ...grpc.CallOption) (*pb.Exists, error)

func (*FakeGuideOcelotClient) PollRepo

func (f *FakeGuideOcelotClient) PollRepo(ctx context.Context, poll *pb.PollRequest, opts ...grpc.CallOption) (*empty.Empty, error)

func (*FakeGuideOcelotClient) RepoCredExists

func (f *FakeGuideOcelotClient) RepoCredExists(ctx context.Context, in *pb.RepoCreds, opts ...grpc.CallOption) (*pb.Exists, error)

func (*FakeGuideOcelotClient) SSHCredExists

func (f *FakeGuideOcelotClient) SSHCredExists(ctx context.Context, in *pb.SSHKeyWrapper, opts ...grpc.CallOption) (*pb.Exists, error)

func (*FakeGuideOcelotClient) SetAppleCreds

func (f *FakeGuideOcelotClient) SetAppleCreds(ctx context.Context, in *pb.AppleCreds, opts ...grpc.CallOption) (*empty.Empty, error)

func (*FakeGuideOcelotClient) SetGenericCreds

func (f *FakeGuideOcelotClient) SetGenericCreds(ctx context.Context, in *pb.GenericCreds, opts ...grpc.CallOption) (*empty.Empty, error)

func (*FakeGuideOcelotClient) SetK8SCreds

func (f *FakeGuideOcelotClient) SetK8SCreds(ctx context.Context, in *pb.K8SCreds, opts ...grpc.CallOption) (*empty.Empty, error)

func (*FakeGuideOcelotClient) SetNotifyCreds

func (f *FakeGuideOcelotClient) SetNotifyCreds(ctx context.Context, in *pb.NotifyCreds, opts ...grpc.CallOption) (*empty.Empty, error)

func (*FakeGuideOcelotClient) SetRepoCreds

func (f *FakeGuideOcelotClient) SetRepoCreds(ctx context.Context, in *pb.RepoCreds, opts ...grpc.CallOption) (*empty.Empty, error)

func (*FakeGuideOcelotClient) SetSSHCreds

func (f *FakeGuideOcelotClient) SetSSHCreds(ctx context.Context, in *pb.SSHKeyWrapper, opts ...grpc.CallOption) (*empty.Empty, error)

func (*FakeGuideOcelotClient) SetVCSCreds

func (f *FakeGuideOcelotClient) SetVCSCreds(ctx context.Context, in *pb.VCSCreds, opts ...grpc.CallOption) (*empty.Empty, error)

func (*FakeGuideOcelotClient) SetVCSPrivateKey

func (f *FakeGuideOcelotClient) SetVCSPrivateKey(ctx context.Context, in *pb.SSHKeyWrapper, opts ...grpc.CallOption) (*empty.Empty, error)

func (*FakeGuideOcelotClient) UpdateAppleCreds

func (f *FakeGuideOcelotClient) UpdateAppleCreds(ctx context.Context, in *pb.AppleCreds, opts ...grpc.CallOption) (*empty.Empty, error)

func (*FakeGuideOcelotClient) UpdateGenericCreds

func (f *FakeGuideOcelotClient) UpdateGenericCreds(ctx context.Context, in *pb.GenericCreds, opts ...grpc.CallOption) (*empty.Empty, error)

func (*FakeGuideOcelotClient) UpdateK8SCreds

func (f *FakeGuideOcelotClient) UpdateK8SCreds(ctx context.Context, in *pb.K8SCreds, opts ...grpc.CallOption) (*empty.Empty, error)

func (*FakeGuideOcelotClient) UpdateNotifyCreds

func (f *FakeGuideOcelotClient) UpdateNotifyCreds(ctx context.Context, in *pb.NotifyCreds, opts ...grpc.CallOption) (*empty.Empty, error)

func (*FakeGuideOcelotClient) UpdateRepoCreds

func (f *FakeGuideOcelotClient) UpdateRepoCreds(ctx context.Context, in *pb.RepoCreds, opts ...grpc.CallOption) (*empty.Empty, error)

func (*FakeGuideOcelotClient) UpdateSSHCreds

func (f *FakeGuideOcelotClient) UpdateSSHCreds(ctx context.Context, in *pb.SSHKeyWrapper, opts ...grpc.CallOption) (*empty.Empty, error)

func (*FakeGuideOcelotClient) UpdateVCSCreds

func (f *FakeGuideOcelotClient) UpdateVCSCreds(ctx context.Context, in *pb.VCSCreds, opts ...grpc.CallOption) (*empty.Empty, error)

func (*FakeGuideOcelotClient) VCSCredExists

func (f *FakeGuideOcelotClient) VCSCredExists(ctx context.Context, in *pb.VCSCreds, opts ...grpc.CallOption) (*pb.Exists, error)

func (*FakeGuideOcelotClient) WatchRepo

func (f *FakeGuideOcelotClient) WatchRepo(ctx context.Context, in *pb.RepoAccount, opts ...grpc.CallOption) (*empty.Empty, error)

Jump to

Keyboard shortcuts

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