Package com.piketec.jenkins.plugins.tpt
Class WorkLoad
java.lang.Object
com.piketec.jenkins.plugins.tpt.WorkLoad
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, Synopsys Inc.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCleans the workload if there is an Interrupted Exeption.Run<?,?> static WorkLoadpollWorkload(String jobName) Pops the workload from the static HashMap.static voidputWorkLoad(String jobName, WorkLoad workloadToAdd) Adds a workload to the static HashMap.
-
Constructor Details
-
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 Details
-
getJenkinsConfig
- Returns:
- the jenkins configuration that contains paths and tpt file names with unresolved $-vars
-
getTestCases
- Returns:
- the test cases that should be executed
-
getDistributingJobWorkspace
- Returns:
- the workspace from the distributing job
-
getDistributingJobRun
- Returns:
- the current build, used to get an unique Id
-
getDistributingJobDataDir
- Returns:
- the path to the data directory of the distributing job
-
getDistributingJobReportDir
- Returns:
- the path to the report directory of the distributing job
-
putWorkLoad
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
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
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
-