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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Descriptor for the publisherNested 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
FieldsModifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
Constructor Summary
ConstructorsConstructorDescriptionRobotPublisher
(String archiveDirName, String outputPath, String outputFileName, boolean disableArchiveOutput, String reportFileName, String logFileName, double passThreshold, double unstableThreshold, boolean onlyCritical, boolean countSkippedTests, String otherFiles, boolean enableCache, String overwriteXAxisLabel) Create new publisher for Robot Framework results -
Method Summary
Modifier and TypeMethodDescriptionvoid
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) Gets the name of archive dir.protected Result
getBuildResult
(Run<?, ?> build, RobotResult result) Determines the build result based on set thresholds.boolean
Gets if skipped tests should be counted in the thresholds.boolean
Get the value of disable Archive of output xml checkboxboolean
Gets value of enableCacheGets the name of log html file.boolean
Gets if only critical tests should be accounted for the thresholds.Gets the comma separated list of other filemasks to copy into build dirGets the name of output xml file.Gets the output path of Robot filesGets the value of overwriteXAxisLabeldouble
Gets the test pass percentage threshold for successful builds.getProjectActions
(AbstractProject<?, ?> project) Gets the name of report html file.static String
Return file suffix from string.double
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 Details
-
DEFAULT_REPORT_FILE
- See Also:
-
DEFAULT_ARCHIVE_DIR
- See Also:
-
DEFAULT_JENKINS_ARCHIVE_DIR
- See Also:
-
-
Constructor Details
-
RobotPublisher
@DataBoundConstructor public RobotPublisher(String archiveDirName, String outputPath, String outputFileName, boolean disableArchiveOutput, String reportFileName, String logFileName, double passThreshold, double unstableThreshold, boolean onlyCritical, boolean countSkippedTests, 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 Details
-
getArchiveDirName
Gets the name of archive dir. Reverts to default if empty or whitespace.- Returns:
- the name of archive dir
-
getOutputPath
Gets the output path of Robot files- Returns:
- the output path of Robot files
-
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
Gets the name of report html file. Reverts to default if empty or whitespace.- Returns:
- the name of report html file
-
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
-
getCountSkippedTests
public boolean getCountSkippedTests()Gets if skipped tests should be counted in the thresholds.- Returns:
- true if skipped tests should be counted in the thresholds
-
getEnableCache
public boolean getEnableCache()Gets value of enableCache- Returns:
- true if cache is enabled
-
getOtherFiles
Gets the comma separated list of other filemasks to copy into build dir- Returns:
- List of files as string
-
getOverwriteXAxisLabel
Gets the value of overwriteXAxisLabel- Returns:
- X axis label for the trend
-
getProjectActions
- 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, InterruptedExceptionCopy 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
Return filename without file suffix.- Parameters:
filename
- Filename with suffix- Returns:
- filename as string
-
getSuffix
Return file suffix from string.- Parameters:
filename
- Filename with suffix- Returns:
- file suffix as string
-
getBuildResult
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
- 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
-