Package com.piketec.jenkins.plugins.tpt
Class WorkLoad
- java.lang.Object
-
- com.piketec.jenkins.plugins.tpt.WorkLoad
-
public class WorkLoad extends Object
Through this class is how the data from a distributing job to a worker job is passed. A way to tell the worker job what testcases should be executed.- Author:
- FInfantino, PikeTec GmbH
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
clean(String jobName, Run<?,?> distributingJobRun)
Cleans the workload if there is an Interrupted Exeption.FilePath
getDistributingJobDataDir()
FilePath
getDistributingJobReportDir()
Run<?,?>
getDistributingJobRun()
FilePath
getDistributingJobWorkspace()
JenkinsConfiguration
getJenkinsConfig()
List<String>
getTestCases()
static WorkLoad
pollWorkload(String jobName)
Pops the workload from the static HashMap.static void
putWorkLoad(String jobName, WorkLoad workloadToAdd)
Adds a workload to the static HashMap.
-
-
-
Constructor Detail
-
WorkLoad
public WorkLoad(JenkinsConfiguration unresolvedConfig, List<String> subTestSet, FilePath distributingJobWorkspace, Run<?,?> distributingJobRun, FilePath distributingJobDataDir, FilePath distributingJobReportDir)
- Parameters:
unresolvedConfig
- JenkinsConfiguration that contains paths and tpt file names with unresolved $-varssubTestSet
- the test cases that should be executed by the workerdistributingJobWorkspace
- the workspace from the distributing job, used for knowing where to copy the resultsdistributingJobRun
- the current build, used in order to get an unique iddistributingJobDataDir
- The test data directory of the distributing jobdistributingJobReportDir
- The report directory the distributing job
-
-
Method Detail
-
getJenkinsConfig
public JenkinsConfiguration getJenkinsConfig()
- Returns:
- the jenkins configuration that contains paths and tpt file names with unresolved $-vars
-
getDistributingJobWorkspace
public FilePath getDistributingJobWorkspace()
- Returns:
- the workspace from the distributing job
-
getDistributingJobRun
public Run<?,?> getDistributingJobRun()
- Returns:
- the current build, used to get an unique Id
-
getDistributingJobDataDir
public FilePath getDistributingJobDataDir()
- Returns:
- the path to the data directory of the distributing job
-
getDistributingJobReportDir
public FilePath getDistributingJobReportDir()
- Returns:
- the path to the report directory of the distributing job
-
putWorkLoad
public static void putWorkLoad(String jobName, WorkLoad workloadToAdd)
Adds a workload to the static HashMap. This method is used when the distributing job put the workload here and then triggers the worker job.- Parameters:
jobName
- The name of the jenkins job serving as a worker.workloadToAdd
- The work package to be executed by the worker job
-
pollWorkload
public static WorkLoad pollWorkload(String jobName)
Pops the workload from the static HashMap. This method is used from the worker when a build has been triggered and it needs to do some workload.- Parameters:
jobName
- The name of the jenkins job serving as a worker job.- Returns:
- the workload that has been removed, null if there is nothing to remove.
-
clean
public static void clean(String jobName, Run<?,?> distributingJobRun)
Cleans the workload if there is an Interrupted Exeption. We dont want to store the workload if something goes wrong.- Parameters:
jobName
- The name of the jenkins job serving as a worker.distributingJobRun
- the build of the distributing job
-
-