fake

package
v1.3.1016 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeJenkins

type FakeJenkins struct {
	Jobs   []gojenkins.Job
	JobMap map[string]*gojenkins.Job
	// contains filtered or unexported fields
}

FakeJenkins contains the state of the fake JenkinsClient

func NewFakeJenkins

func NewFakeJenkins() *FakeJenkins

NewFakeJenkins creates a fake JenkinsClient that can be used in tests

func (*FakeJenkins) AddJobToView

func (j *FakeJenkins) AddJobToView(string, gojenkins.Job) error

AddJobToView adds a job to the view

func (*FakeJenkins) BaseURL

func (j *FakeJenkins) BaseURL() string

BaseURL returns the server base URL

func (*FakeJenkins) Build

func (j *FakeJenkins) Build(gojenkins.Job, url.Values) error

Build triggers a build

func (*FakeJenkins) CreateCredential

func (j *FakeJenkins) CreateCredential(string, string, string) error

CreateCredential creates a credential

func (*FakeJenkins) CreateFolderJobWithXML

func (j *FakeJenkins) CreateFolderJobWithXML(jobXml string, folder string, jobName string) error

CreateFolderJobWithXML creates a folder based job from XML

func (*FakeJenkins) CreateJob

func (j *FakeJenkins) CreateJob(gojenkins.JobItem, string) error

CreateJob creates a job

func (*FakeJenkins) CreateJobWithXML

func (j *FakeJenkins) CreateJobWithXML(jobXml string, folder string) error

CreateJobWithXML create a job from XML

func (*FakeJenkins) CreateView

func (j *FakeJenkins) CreateView(gojenkins.ListView) error

CreateView creates a view

func (*FakeJenkins) DeleteJob

func (j *FakeJenkins) DeleteJob(gojenkins.Job) error

DeleteJob deletes a job

func (*FakeJenkins) GetArtifact

func (j *FakeJenkins) GetArtifact(gojenkins.Build, gojenkins.Artifact) ([]byte, error)

GetArtifact gets an artifact

func (*FakeJenkins) GetBuild

func (j *FakeJenkins) GetBuild(gojenkins.Job, int) (gojenkins.Build, error)

GetBuild gets the build for a specific job and build number

func (*FakeJenkins) GetBuildConsoleOutput

func (j *FakeJenkins) GetBuildConsoleOutput(gojenkins.Build) ([]byte, error)

GetBuildConsoleOutput get the console output

func (*FakeJenkins) GetBuildURL

func (j *FakeJenkins) GetBuildURL(gojenkins.Job, int) string

GetBuildURL gets the build URL

func (*FakeJenkins) GetComputer

func (j *FakeJenkins) GetComputer(string) (gojenkins.Computer, error)

GetComputer gets the computer

func (*FakeJenkins) GetComputerObject

func (j *FakeJenkins) GetComputerObject() (gojenkins.ComputerObject, error)

GetComputerObject gets the computer

func (*FakeJenkins) GetComputers

func (j *FakeJenkins) GetComputers() ([]gojenkins.Computer, error)

GetComputers gets the computers

func (*FakeJenkins) GetCredential

func (j *FakeJenkins) GetCredential(string) (*gojenkins.Credentials, error)

GetCredential get the credential of the given name

func (*FakeJenkins) GetJob

func (j *FakeJenkins) GetJob(name string) (gojenkins.Job, error)

GetJob gets a job by name

func (*FakeJenkins) GetJobByPath

func (j *FakeJenkins) GetJobByPath(names ...string) (gojenkins.Job, error)

GetJobByPath fake

func (*FakeJenkins) GetJobConfig

func (j *FakeJenkins) GetJobConfig(name string) (gojenkins.JobItem, error)

GetJobConfig gets the job config for the given name

func (*FakeJenkins) GetJobURLPath

func (j *FakeJenkins) GetJobURLPath(name string) string

GetJobURLPath gets the job URL patjh

func (*FakeJenkins) GetJobs

func (j *FakeJenkins) GetJobs() ([]gojenkins.Job, error)

GetJobs returns the jobs

func (*FakeJenkins) GetLastBuild

func (j *FakeJenkins) GetLastBuild(gojenkins.Job) (gojenkins.Build, error)

GetLastBuild returns the last build of the job

func (*FakeJenkins) GetLogFromURL

func (j *FakeJenkins) GetLogFromURL(string, int64, *gojenkins.LogData) error

GetLogFromURL gets the log from a URL

func (*FakeJenkins) GetMultiBranchJob

func (j *FakeJenkins) GetMultiBranchJob(string, string, string) (gojenkins.Job, error)

GetMultiBranchJob gets a multi branch job of the given name

func (*FakeJenkins) GetOrganizationScanResult

func (j *FakeJenkins) GetOrganizationScanResult(int, gojenkins.Job) (string, error)

GetOrganizationScanResult returns the organisation scan result

func (*FakeJenkins) GetQueue

func (j *FakeJenkins) GetQueue() (gojenkins.Queue, error)

GetQueue gets the build queue

func (*FakeJenkins) IsErrNotFound

func (j *FakeJenkins) IsErrNotFound(err error) bool

IsErrNotFound returns true if the error is not found

func (*FakeJenkins) NewLogPoller

func (j *FakeJenkins) NewLogPoller(string, io.Writer) *gojenkins.LogPoller

NewLogPoller creates a new log poller

func (*FakeJenkins) Post

func (j *FakeJenkins) Post(string, url.Values, interface{}) (err error)

Post posts an object

func (*FakeJenkins) QuietDown

func (j *FakeJenkins) QuietDown() error

QuietDown quiets down

func (*FakeJenkins) Reload

func (j *FakeJenkins) Reload() error

Reload reloads the fake server

func (*FakeJenkins) RemoveJob

func (j *FakeJenkins) RemoveJob(string) error

RemoveJob removes a job

func (*FakeJenkins) Restart

func (j *FakeJenkins) Restart() error

Restart restarts the fake server

func (*FakeJenkins) SafeRestart

func (j *FakeJenkins) SafeRestart() error

SafeRestart safely restarts the fake server

func (*FakeJenkins) SetBuildDescription

func (j *FakeJenkins) SetBuildDescription(gojenkins.Build, string) error

SetBuildDescription sets the build description

func (*FakeJenkins) SetHTTPClient

func (j *FakeJenkins) SetHTTPClient(*http.Client)

SetHTTPClient sets the http client

func (*FakeJenkins) StopBuild

func (j *FakeJenkins) StopBuild(gojenkins.Job, int) error

StopBuild stops the build

func (*FakeJenkins) TailLog

TailLog tails the log

func (*FakeJenkins) TailLogFunc

func (j *FakeJenkins) TailLogFunc(string, io.Writer) gojenkins.ConditionFunc

TailLogFunc tails the log function

func (*FakeJenkins) UpdateJob

func (j *FakeJenkins) UpdateJob(gojenkins.JobItem, string) error

UpdateJob updates a job

Jump to

Keyboard shortcuts

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