Package hudson.plugins.robot
Class RobotPublisher
- java.lang.Object
-
- hudson.tasks.BuildStepCompatibilityLayer
-
- hudson.tasks.Publisher
-
- hudson.tasks.Recorder
-
- hudson.plugins.robot.RobotPublisher
-
- All Implemented Interfaces:
ExtensionPoint
,hudson.matrix.MatrixAggregatable
,Describable<Publisher>
,BuildStep
,Serializable
,SimpleBuildStep
public class RobotPublisher extends Recorder implements Serializable, hudson.matrix.MatrixAggregatable, SimpleBuildStep
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RobotPublisher.DescriptorImpl
Descriptor for the publisher-
Nested classes/interfaces inherited from class hudson.tasks.Publisher
Publisher.DescriptorExtensionListImpl
-
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherList
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Nested classes/interfaces inherited from interface jenkins.tasks.SimpleBuildStep
SimpleBuildStep.LastBuildAction, SimpleBuildStep.LastBuildActionFactory
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
DEFAULT_ARCHIVE_DIR
protected static String
DEFAULT_JENKINS_ARCHIVE_DIR
protected static String
DEFAULT_REPORT_FILE
-
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
-
Constructor Summary
Constructors Constructor Description RobotPublisher(String archiveDirName, String outputPath, String outputFileName, boolean disableArchiveOutput, String reportFileName, String logFileName, double passThreshold, double unstableThreshold, boolean onlyCritical, String otherFiles, boolean enableCache, String overwriteXAxisLabel)
Create new publisher for Robot Framework results
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copyFilesToBuildDir(Run<?,?> build, FilePath workspace, String inputPath, String filemaskToCopy)
Copy files with given filemasks from input path relative to build into specific build file archive dirhudson.matrix.MatrixAggregator
createAggregator(hudson.matrix.MatrixBuild build, Launcher launcher, BuildListener listener)
String
getArchiveDirName()
Gets the name of archive dir.protected Result
getBuildResult(Run<?,?> build, RobotResult result)
Determines the build result based on set thresholds.boolean
getDisableArchiveOutput()
Get the value of disable Archive of output xml checkboxboolean
getEnableCache()
Gets value of enableCacheString
getLogFileName()
Gets the name of log html file.boolean
getOnlyCritical()
Gets if only critical tests should be accounted for the thresholds.String
getOtherFiles()
Gets the comma separated list of other filemasks to copy into build dirString
getOutputFileName()
Gets the name of output xml file.String
getOutputPath()
Gets the output path of Robot filesString
getOverwriteXAxisLabel()
Gets the value of overwriteXAxisLabeldouble
getPassThreshold()
Gets the test pass percentage threshold for successful builds.Collection<Action>
getProjectActions(AbstractProject<?,?> project)
String
getReportFileName()
Gets the name of report html file.BuildStepMonitor
getRequiredMonitorService()
static String
getSuffix(String filename)
Return file suffix from string.double
getUnstableThreshold()
Gets the test pass percentage threshold for unstable builds.protected RobotResult
parse(String expandedTestResults, String expandedLogFileName, String expandedReportFileName, String outputPath, Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener)
void
perform(Run<?,?> build, FilePath workspace, EnvVars buildEnv, Launcher launcher, TaskListener listener)
static String
trimSuffix(String filename)
Return filename without file suffix.-
Methods inherited from class hudson.tasks.Recorder
getDescriptor
-
Methods inherited from class hudson.tasks.Publisher
all, getProjectAction, needsToRunAfterFinalized, prebuild
-
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, perform, perform, prebuild
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface hudson.tasks.BuildStep
getProjectAction, perform, prebuild
-
Methods inherited from interface jenkins.tasks.SimpleBuildStep
perform, perform, requiresWorkspace
-
-
-
-
Field Detail
-
DEFAULT_REPORT_FILE
protected static final String DEFAULT_REPORT_FILE
- See Also:
- Constant Field Values
-
DEFAULT_ARCHIVE_DIR
protected static final String DEFAULT_ARCHIVE_DIR
- See Also:
- Constant Field Values
-
DEFAULT_JENKINS_ARCHIVE_DIR
protected static final String DEFAULT_JENKINS_ARCHIVE_DIR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RobotPublisher
@DataBoundConstructor public RobotPublisher(String archiveDirName, String outputPath, String outputFileName, boolean disableArchiveOutput, String reportFileName, String logFileName, double passThreshold, double unstableThreshold, boolean onlyCritical, String otherFiles, boolean enableCache, String overwriteXAxisLabel)
Create new publisher for Robot Framework results- Parameters:
archiveDirName
- Name of Archive diroutputPath
- Path to Robot Framework's output filesoutputFileName
- Name of Robot output xmldisableArchiveOutput
- Disable Archiving output xml file to serverreportFileName
- Name of Robot report htmllogFileName
- Name of Robot log htmlpassThreshold
- Threshold of test pass percentage for successful buildsunstableThreshold
- Threshold of test pass percentage for unstable buildsonlyCritical
- True if only critical tests are included in pass percentageotherFiles
- Other files to be savedenableCache
- True if caching is used
-
-
Method Detail
-
getArchiveDirName
public String getArchiveDirName()
Gets the name of archive dir. Reverts to default if empty or whitespace.- Returns:
- the name of archive dir
-
getOutputPath
public String getOutputPath()
Gets the output path of Robot files- Returns:
- the output path of Robot files
-
getOutputFileName
public String getOutputFileName()
Gets the name of output xml file. Reverts to default if empty or whitespace.- Returns:
- the name of output xml file
-
getDisableArchiveOutput
public boolean getDisableArchiveOutput()
Get the value of disable Archive of output xml checkbox- Returns:
- the value of disable Archive of output xml checkbox
-
getReportFileName
public String getReportFileName()
Gets the name of report html file. Reverts to default if empty or whitespace.- Returns:
- the name of report html file
-
getLogFileName
public String getLogFileName()
Gets the name of log html file. Reverts to default if empty or whitespace.- Returns:
- the name of log html file
-
getPassThreshold
public double getPassThreshold()
Gets the test pass percentage threshold for successful builds.- Returns:
- the test pass percentage threshold for successful builds
-
getUnstableThreshold
public double getUnstableThreshold()
Gets the test pass percentage threshold for unstable builds.- Returns:
- the test pass percentage threshold for unstable builds
-
getOnlyCritical
public boolean getOnlyCritical()
Gets if only critical tests should be accounted for the thresholds.- Returns:
- true if only critical tests should be accounted for the thresholds
-
getEnableCache
public boolean getEnableCache()
Gets value of enableCache- Returns:
- true if cache is enabled
-
getOtherFiles
public String getOtherFiles()
Gets the comma separated list of other filemasks to copy into build dir- Returns:
- List of files as string
-
getOverwriteXAxisLabel
public String getOverwriteXAxisLabel()
Gets the value of overwriteXAxisLabel- Returns:
- X axis label for the trend
-
getProjectActions
public Collection<Action> getProjectActions(AbstractProject<?,?> project)
- Specified by:
getProjectActions
in interfaceBuildStep
- Overrides:
getProjectActions
in classBuildStepCompatibilityLayer
-
parse
protected RobotResult parse(String expandedTestResults, String expandedLogFileName, String expandedReportFileName, String outputPath, Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
perform
public void perform(Run<?,?> build, @Nonnull FilePath workspace, @Nonnull EnvVars buildEnv, @Nonnull Launcher launcher, @Nonnull TaskListener listener) throws InterruptedException, IOException
- Specified by:
perform
in interfaceSimpleBuildStep
- Throws:
InterruptedException
IOException
-
copyFilesToBuildDir
public void copyFilesToBuildDir(Run<?,?> build, FilePath workspace, String inputPath, String filemaskToCopy) throws IOException, InterruptedException
Copy files with given filemasks from input path relative to build into specific build file archive dir- Parameters:
build
- The Jenkins runinputPath
- Base path for copy. Relative to build workspace.filemaskToCopy
- List of Ant GLOB style filemasks to copy from dirs specified at inputPathMaskworkspace
- Build workspace- Throws:
IOException
- thrown exceptionInterruptedException
- thrown exception
-
trimSuffix
public static String trimSuffix(String filename)
Return filename without file suffix.- Parameters:
filename
- Filename with suffix- Returns:
- filename as string
-
getSuffix
public static String getSuffix(String filename)
Return file suffix from string.- Parameters:
filename
- Filename with suffix- Returns:
- file suffix as string
-
getBuildResult
protected Result getBuildResult(Run<?,?> build, RobotResult result)
Determines the build result based on set thresholds. If build is already failed before the tests it won't be changed to successful.- Parameters:
build
- Build to be evaluatedresult
- Results associated to build- Returns:
- Result of build
-
getRequiredMonitorService
public BuildStepMonitor getRequiredMonitorService()
- Specified by:
getRequiredMonitorService
in interfaceBuildStep
-
createAggregator
public hudson.matrix.MatrixAggregator createAggregator(hudson.matrix.MatrixBuild build, Launcher launcher, BuildListener listener)
- Specified by:
createAggregator
in interfacehudson.matrix.MatrixAggregatable
-
-