test

package
v0.0.0-...-4e216c0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeCallbackInvoker

type FakeCallbackInvoker struct {
	CallbackURL string
	Success     bool
	Messages    []string
	Labels      map[string]string
	Result      []string
}

FakeCallbackInvoker provides the fake callback invoker

func (*FakeCallbackInvoker) ExecuteCallback

func (f *FakeCallbackInvoker) ExecuteCallback(callbackURL string, success bool, labels map[string]string, messages []string) []string

ExecuteCallback executes the fake callback

type FakeDownloader

type FakeDownloader struct {
	URL    []url.URL
	Target []string
	Err    map[string]error
	// contains filtered or unexported fields
}

FakeDownloader provides a fake downloader interface

func (*FakeDownloader) Download

func (f *FakeDownloader) Download(url *url.URL, target string) (*git.SourceInfo, error)

Download downloads a fake file from the URL

type FakeGit

type FakeGit struct {
	CloneSource *git.URL
	CloneTarget string
	CloneError  error

	CheckoutRepo  string
	CheckoutRef   string
	CheckoutError error

	SubmoduleInitRepo  string
	SubmoduleInitError error

	SubmoduleUpdateRepo      string
	SubmoduleUpdateInit      bool
	SubmoduleUpdateRecursive bool
	SubmoduleUpdateError     error
}

FakeGit provides a fake Git

func (*FakeGit) Checkout

func (f *FakeGit) Checkout(repo, ref string) error

Checkout checkouts a ref in the fake Git repository

func (*FakeGit) Clone

func (f *FakeGit) Clone(source *git.URL, target string, c git.CloneConfig) error

Clone clones the fake source Git repository to target directory

func (*FakeGit) GetInfo

func (f *FakeGit) GetInfo(repo string) *git.SourceInfo

GetInfo retrieves the information about the source code and commit

func (*FakeGit) LsTree

func (f *FakeGit) LsTree(repo, ref string, recursive bool) ([]os.FileInfo, error)

LsTree returns a slice of os.FileInfo objects populated with the paths and file modes of files known to Git. This is used on Windows systems where the executable mode metadata is lost on git checkout.

func (*FakeGit) SubmoduleInit

func (f *FakeGit) SubmoduleInit(repo string) error

SubmoduleInit initializes / clones submodules.

func (*FakeGit) SubmoduleUpdate

func (f *FakeGit) SubmoduleUpdate(repo string, init, recursive bool) error

SubmoduleUpdate checks out submodules to their correct version

type FakeInstaller

type FakeInstaller struct {
	Scripts [][]string
	DstDir  []string
	Error   error
}

FakeInstaller provides a fake installer

func (*FakeInstaller) InstallOptional

func (f *FakeInstaller) InstallOptional(scripts []string, dstDir string) []api.InstallResult

InstallOptional downloads and installs optional scripts into dstDir

func (*FakeInstaller) InstallRequired

func (f *FakeInstaller) InstallRequired(scripts []string, dstDir string) ([]api.InstallResult, error)

InstallRequired downloads and installs required scripts into dstDir

type FakeTar

type FakeTar struct {
	CreateTarBase   string
	CreateTarDir    string
	CreateTarResult string
	CreateTarError  error

	ExtractTarDir    string
	ExtractTarReader io.Reader
	ExtractTarError  error
	// contains filtered or unexported fields
}

FakeTar provides a fake UNIX tar interface

func (*FakeTar) Copy

func (f *FakeTar) Copy() *FakeTar

Copy returns a copy of the FakeTar object

func (*FakeTar) CreateTarFile

func (f *FakeTar) CreateTarFile(base, dir string) (string, error)

CreateTarFile creates a new fake UNIX tar file

func (*FakeTar) CreateTarStream

func (f *FakeTar) CreateTarStream(dir string, includeDirInPath bool, writer io.Writer) error

CreateTarStream creates a tar from the given directory and streams it to the given writer.

func (*FakeTar) CreateTarStreamReader

func (f *FakeTar) CreateTarStreamReader(dir string, includeDirInPath bool) io.ReadCloser

CreateTarStreamReader returns an io.ReadCloser from which a tar stream can be read. The tar stream is created using CreateTarStream.

func (*FakeTar) CreateTarStreamToTarWriter

func (f *FakeTar) CreateTarStreamToTarWriter(dir string, includeDirInPath bool, writer tar.Writer, logger io.Writer) error

CreateTarStreamToTarWriter creates a tar from the given directory and streams it to the given writer.

func (*FakeTar) ExtractTarStream

func (f *FakeTar) ExtractTarStream(dir string, reader io.Reader) error

ExtractTarStream streams a content of fake tar

func (*FakeTar) ExtractTarStreamFromTarReader

func (f *FakeTar) ExtractTarStreamFromTarReader(dir string, tarReader tar.Reader, logger io.Writer) error

ExtractTarStreamFromTarReader streams a content of fake tar from a tar.Reader

func (*FakeTar) ExtractTarStreamWithLogging

func (f *FakeTar) ExtractTarStreamWithLogging(dir string, reader io.Reader, logger io.Writer) error

ExtractTarStreamWithLogging streams a content of fake tar

func (*FakeTar) SetExclusionPattern

func (f *FakeTar) SetExclusionPattern(*regexp.Regexp)

SetExclusionPattern sets the exclusion pattern

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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