Package com.synopsys.defensics.jenkins
Class FuzzJobRunner
- java.lang.Object
-
- com.synopsys.defensics.jenkins.FuzzJobRunner
-
public class FuzzJobRunner extends Object
This class handles the process of starting a fuzz test with Defensics and monitoring its progress.
-
-
Constructor Summary
Constructors Constructor Description FuzzJobRunner()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
publishResultPackage(Run<?,?> jenkinsRun, Run defensicsRun, FilePath testPlan)
Downloads and archives result package for the test run.void
publishResults(Run<?,?> jenkinsRun, Run defensicsRun, FilePath workspace, String testPlanName)
Publish results.void
run(Run<?,?> jenkinsRun, FilePath workspace, Launcher launcher, Logger logger, FilePath testPlan, String configurationOverrides, InstanceConfiguration instanceConfiguration, boolean saveResultPackage)
Run fuzz tests with Defensics and publish resulting HTML report.
-
-
-
Constructor Detail
-
FuzzJobRunner
public FuzzJobRunner()
Default constructor.TODO: Check later if this can be augmented to take all related service objects as constructor arguments so writing unit tests would be cleaner. Some related service objects require jenkinsRun information etc., so need to check how this object lifecycle goes.
-
-
Method Detail
-
run
public void run(Run<?,?> jenkinsRun, FilePath workspace, Launcher launcher, Logger logger, FilePath testPlan, String configurationOverrides, InstanceConfiguration instanceConfiguration, boolean saveResultPackage) throws AbortException
Run fuzz tests with Defensics and publish resulting HTML report.- Parameters:
jenkinsRun
- Jenkins run that started this.workspace
- Workspace of Jenkins job.launcher
- Launcher of Jenkins run.testPlan
- Fuzz testing is done according to this plan.configurationOverrides
- String containing configuration overridesinstanceConfiguration
- Configuration for Defensics instance that should run the tests.saveResultPackage
- Download and save result package for Defensics run?- Throws:
AbortException
-
publishResults
public void publishResults(Run<?,?> jenkinsRun, Run defensicsRun, FilePath workspace, String testPlanName) throws Exception
Publish results. Handles publishing HTML report and adding actions to both build and job level.- Parameters:
jenkinsRun
- The Jenkins run whose results are being publisheddefensicsRun
- The Defensics run whose results are being publishedworkspace
- Jenkins workspace, used to temporarily store report files.testPlanName
- Testplan filename. This is used as title for the report tab, which helps identify results if there are multiple Defensics steps in the Jenkins job.- Throws:
DefensicsRequestException
- If server responds with errorIOException
- If deleting the temporary report files in workspace failsInterruptedException
- If deleting the temporary report files in workspace is interrupted.Exception
-
publishResultPackage
public void publishResultPackage(Run<?,?> jenkinsRun, Run defensicsRun, FilePath testPlan) throws Exception
Downloads and archives result package for the test run. Adds action to provide html link in the build results.- Parameters:
jenkinsRun
- Jenkins rundefensicsRun
- Defensics runtestPlan
- Originally used test plan file to construct result-package file name- Throws:
Exception
- SeesaveResultPackage
for possible exceptions
-
-