test

package
v0.0.0-...-901927a Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2019 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GitSourceName         = "some-repo-gs"
	GitSourceAnalysisName = "some-repo-gsa"
	Namespace             = "my-namespace"
)
View Source
const SecretName = "my-secret"

Variables

This section is empty.

Functions

func AssertContainsBuildTool

func AssertContainsBuildTool(t *testing.T, detected []v1alpha1.DetectedBuildType, name, language string, files ...string)

func Boolean

func Boolean(value bool) *bool

func MockGHGetApiCalls

func MockGHGetApiCalls(t *testing.T, prjPath, branch string, files, langs SliceOfStrings, modifiers ...GockModifier)

func MockGHHeadCalls

func MockGHHeadCalls(prjPath, branch string, files SliceOfStrings, modifiers ...GockModifier)

func MockNotFoundGitHub

func MockNotFoundGitHub(repoIdentifier string)

func NewDummyServiceCreator

func NewDummyServiceCreator(flavor string, shouldFail bool, files, langs SliceOfStrings) repository.ServiceCreator

func NewGitSource

func NewGitSource(modifiers ...GitSourceModifier) *v1alpha1.GitSource

func NewGitSourceAnalysis

func NewGitSourceAnalysis(gitSourceName string) *v1alpha1.GitSourceAnalysis

func NewReconcileRequest

func NewReconcileRequest(name string) reconcile.Request

func NewSecret

func NewSecret(secretType corev1.SecretType, data map[string][]byte) *corev1.Secret

func PrepareClient

func PrepareClient(gvkObjects ...GvkObject) (client.Client, *runtime.Scheme)

func PrivateWithPassphrase

func PrivateWithPassphrase(t *testing.T, pathToTestDir string) []byte

func PrivateWithoutPassphrase

func PrivateWithoutPassphrase(t *testing.T, pathToTestDir string) []byte

func PublicWithPassphrase

func PublicWithPassphrase(t *testing.T, pathToTestDir string) []byte

func PublicWithoutPassphrase

func PublicWithoutPassphrase(t *testing.T, pathToTestDir string) []byte

func RunBasicSshServer

func RunBasicSshServer(t *testing.T, password string) func()

func RunKeySshServer

func RunKeySshServer(t *testing.T, allowedPublicKey []byte) func()

func String

func String(value string) *string

func TurnOffAllGockWhenMatched

func TurnOffAllGockWhenMatched() gock.Matcher

TurnOffAllGockWhenMatched turns off all gock mocks when the matcher is matched

Types

type DummyGitRepo

type DummyGitRepo struct {
	Path string
	// contains filtered or unexported fields
}

func NewDummyGitRepo

func NewDummyGitRepo(t *testing.T, branchName string) *DummyGitRepo

func (*DummyGitRepo) CheckoutBranch

func (r *DummyGitRepo) CheckoutBranch(branchName string)

func (*DummyGitRepo) Commit

func (r *DummyGitRepo) Commit(fileNames ...string) string

type DummyService

type DummyService struct {
	Files, Langs []string

	Flavor          string
	UseFilesChecker bool
	// contains filtered or unexported fields
}

func NewDummyService

func NewDummyService(flavor string, shouldFail bool, files, langs SliceOfStrings, useFilesChecker bool) *DummyService

func NewDummyServices

func NewDummyServices(flavor string, shouldFail bool, files, langs SliceOfStrings) []*DummyService

func (*DummyService) CheckBranch

func (s *DummyService) CheckBranch() error

func (*DummyService) CheckCredentials

func (s *DummyService) CheckCredentials() error

func (*DummyService) CheckRepoAccessibility

func (s *DummyService) CheckRepoAccessibility() error

func (*DummyService) Creator

func (s *DummyService) Creator() repository.ServiceCreator

func (*DummyService) FileExistenceChecker

func (s *DummyService) FileExistenceChecker() (repository.FileExistenceChecker, error)

func (*DummyService) GetLanguageList

func (s *DummyService) GetLanguageList() ([]string, error)

type GitSourceModifier

type GitSourceModifier func(*v1alpha1.GitSource)

func WithFlavor

func WithFlavor(flavor string) GitSourceModifier

func WithRef

func WithRef(ref string) GitSourceModifier

func WithURL

func WithURL(url string) GitSourceModifier

type GockModifier

type GockModifier func(mock *gock.Request)

type GvkObject

type GvkObject func() (schema.GroupVersion, []runtime.Object)

func RegisterGvkObject

func RegisterGvkObject(gv schema.GroupVersion, types ...runtime.Object) GvkObject

type SliceOfStrings

type SliceOfStrings func() []string

func S

func S(values ...string) SliceOfStrings

Jump to

Keyboard shortcuts

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