Documentation ¶
Index ¶
Constants ¶
View Source
const (
// LogFileExt is the file extension used for log files
LogFileExt = ".log"
)
Variables ¶
View Source
var ( // LogDIR is the absolute path to the CI log directory LogDIR = filepath.Join(ciDIR, "logs") )
Functions ¶
func ActiveCISession ¶
ActiveCISession returns true if a ci session is active it returns false otherwise
func Run ¶
func Run(job *JobDetails)
Run triggers the CI server for the given job It builds the absolute path to the job log file, creating necessary parent directories It terminates if a routine is currently active for the given job Otherwise, sets up a new routine for the job
Types ¶
type JobDetails ¶
type JobDetails struct { // LogFileName is the name to be used for the test output log. // It should always be the commit hash e.g 5eace776ec66a70b2775f4bbb9e2b2847331b0a9 // or branch name e.g master LogFileName string // ProjectRespositoryName is the name of the project's repository on the VCS // It's used when cloning the project in test container ProjectRespositoryName string // ProjectBranch is the target branch to run the tests on // It could also be a commit hash if the target is a particular commit ProjectBranch string // ProjectRespositoryURL is the SSH url for pull the code from the VCS ProjectRepositoryURL string // ProjectLanguage is the programming language the project is written in // This would be used to determine the docker image for running the tests ProjectLanguage string // UpdateBuildStatus is a callback function that would be executed with updates of the test // It would be executed with the build status pending, failure, success as argument // Once the tests starts, it's executed with the pending status argument // At test completion it would be executed again with the result status: success or failure UpdateBuildStatus func(string) // contains filtered or unexported fields }
JobDetails contains necessary information required to run tests for a given project
Click to show internal directories.
Click to hide internal directories.