jx: github.com/jenkins-x/jx/pkg/jenkins/fake Index | Files

package fake

import "github.com/jenkins-x/jx/pkg/jenkins/fake"


Package Files


type FakeJenkins Uses

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 Uses

func NewFakeJenkins() *FakeJenkins

NewFakeJenkins creates a fake JenkinsClient that can be used in tests

func (*FakeJenkins) AddJobToView Uses

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

AddJobToView adds a job to the view

func (*FakeJenkins) BaseURL Uses

func (j *FakeJenkins) BaseURL() string

BaseURL returns the server base URL

func (*FakeJenkins) Build Uses

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

Build triggers a build

func (*FakeJenkins) CreateCredential Uses

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

CreateCredential creates a credential

func (*FakeJenkins) CreateFolderJobWithXML Uses

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

CreateFolderJobWithXML creates a folder based job from XML

func (*FakeJenkins) CreateJob Uses

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

CreateJob creates a job

func (*FakeJenkins) CreateJobWithXML Uses

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

CreateJobWithXML create a job from XML

func (*FakeJenkins) CreateView Uses

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

CreateView creates a view

func (*FakeJenkins) DeleteJob Uses

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

DeleteJob deletes a job

func (*FakeJenkins) GetArtifact Uses

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

GetArtifact gets an artifact

func (*FakeJenkins) GetBuild Uses

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

GetBuild gets the build for a specific job and build number

func (*FakeJenkins) GetBuildConsoleOutput Uses

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

GetBuildConsoleOutput get the console output

func (*FakeJenkins) GetBuildURL Uses

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

GetBuildURL gets the build URL

func (*FakeJenkins) GetComputer Uses

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

GetComputer gets the computer

func (*FakeJenkins) GetComputerObject Uses

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

GetComputerObject gets the computer

func (*FakeJenkins) GetComputers Uses

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

GetComputers gets the computers

func (*FakeJenkins) GetCredential Uses

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

GetCredential get the credential of the given name

func (*FakeJenkins) GetJob Uses

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

GetJob gets a job by name

func (*FakeJenkins) GetJobByPath Uses

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

GetJobByPath fake

func (*FakeJenkins) GetJobConfig Uses

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

GetJobConfig gets the job config for the given name

func (*FakeJenkins) GetJobURLPath Uses

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

GetJobURLPath gets the job URL patjh

func (*FakeJenkins) GetJobs Uses

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

GetJobs returns the jobs

func (*FakeJenkins) GetLastBuild Uses

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

GetLastBuild returns the last build of the job

func (*FakeJenkins) GetLogFromURL Uses

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

GetLogFromURL gets the log from a URL

func (*FakeJenkins) GetMultiBranchJob Uses

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

GetMultiBranchJob gets a multi branch job of the given name

func (*FakeJenkins) GetOrganizationScanResult Uses

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

GetOrganizationScanResult returns the organisation scan result

func (*FakeJenkins) GetQueue Uses

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

GetQueue gets the build queue

func (*FakeJenkins) IsErrNotFound Uses

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

IsErrNotFound returns true if the error is not found

func (*FakeJenkins) NewLogPoller Uses

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

NewLogPoller creates a new log poller

func (*FakeJenkins) Post Uses

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

Post posts an object

func (*FakeJenkins) QuietDown Uses

func (j *FakeJenkins) QuietDown() error

QuietDown quiets down

func (*FakeJenkins) Reload Uses

func (j *FakeJenkins) Reload() error

Reload reloads the fake server

func (*FakeJenkins) RemoveJob Uses

func (j *FakeJenkins) RemoveJob(string) error

RemoveJob removes a job

func (*FakeJenkins) Restart Uses

func (j *FakeJenkins) Restart() error

Restart restarts the fake server

func (*FakeJenkins) SafeRestart Uses

func (j *FakeJenkins) SafeRestart() error

SafeRestart safely restarts the fake server

func (*FakeJenkins) SetBuildDescription Uses

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

SetBuildDescription sets the build description

func (*FakeJenkins) SetHTTPClient Uses

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

SetHTTPClient sets the http client

func (*FakeJenkins) StopBuild Uses

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

StopBuild stops the build

func (*FakeJenkins) TailLog Uses

func (j *FakeJenkins) TailLog(string, io.Writer, time.Duration, time.Duration) error

TailLog tails the log

func (*FakeJenkins) TailLogFunc Uses

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

TailLogFunc tails the log function

func (*FakeJenkins) UpdateJob Uses

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

UpdateJob updates a job

Package fake imports 7 packages (graph). Updated 2019-11-11. Refresh now. Tools for package owners.