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 classDescriptor for the publisherNested classes/interfaces inherited from class Publisher
Publisher.DescriptorExtensionListImplNested classes/interfaces inherited from interface BuildStep
BuildStep.PublisherListNested classes/interfaces inherited from interface ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudsonNested classes/interfaces inherited from interface SimpleBuildStep
SimpleBuildStep.LastBuildAction, SimpleBuildStep.LastBuildActionFactory -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final StringFields inherited from interface BuildStep
BUILDERS, PUBLISHERS -
Constructor Summary
ConstructorsConstructorDescriptionRobotPublisher(String archiveDirName, String outputPath, String outputFileName, boolean disableArchiveOutput, String reportFileName, String logFileName, double passThreshold, double unstableThreshold, boolean countSkippedTests, String otherFiles, boolean enableCache, String overwriteXAxisLabel, boolean useArtifactManager) Create new publisher for Robot Framework results -
Method Summary
Modifier and TypeMethodDescriptionvoidarchiveFilesToDestination(Run<?, ?> build, FilePath workspace, String inputPath, String artifactsFilemask, Launcher launcher, TaskListener listener) Copy files with given filemasks from input path relative to Artifact ManagervoidcopyFilesToBuildDir(Run<?, ?> build, FilePath workspace, String inputPath, String filemaskToCopy) Copy files with given filemasks from input path relative to build into local build file archive dirvoidcopyFilesToDestination(Run<?, ?> build, FilePath workspace, String inputPath, String filemaskToCopy, Launcher launcher, TaskListener listener) Copy files with given filemasks from input path relative to build into local build archive dir or artifact manager destinationhudson.matrix.MatrixAggregatorcreateAggregator(hudson.matrix.MatrixBuild build, Launcher launcher, BuildListener listener) Gets the name of archive dir.protected ResultgetBuildResult(Run<?, ?> build, RobotResult result) Determines the build result based on set thresholds.booleanGets if skipped tests should be counted in the thresholds.booleanGet the value of disable Archive of output xml checkboxbooleanGets value of enableCacheGets the name of log html file.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 overwriteXAxisLabeldoubleGets the test pass percentage threshold for successful builds.getProjectActions(AbstractProject<?, ?> project) Gets the name of report html file.static StringReturn file suffix from string.doubleGets the test pass percentage threshold for unstable builds.booleanGets value of useArtifactManagerprotected RobotResultparse(String expandedTestResults, String expandedLogFileName, String expandedReportFileName, String outputPath, Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) voidperform(Run<?, ?> build, FilePath workspace, EnvVars buildEnv, Launcher launcher, TaskListener listener) static StringtrimSuffix(String filename) Return filename without file suffix.Methods inherited from class Recorder
getDescriptorMethods inherited from class Publisher
all, getProjectAction, needsToRunAfterFinalized, prebuildMethods inherited from class BuildStepCompatibilityLayer
getProjectAction, perform, perform, prebuildMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BuildStep
getProjectAction, perform, prebuildMethods inherited from interface 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 countSkippedTests, String otherFiles, boolean enableCache, String overwriteXAxisLabel, boolean useArtifactManager) 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 buildsotherFiles- Other files to be savedenableCache- True if caching is useduseArtifactManager- True if Artifact Manager 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
-
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
-
getUseArtifactManager
public boolean getUseArtifactManager()Gets value of useArtifactManager- Returns:
- true if Artifact Manager is used
-
getProjectActions
- Specified by:
getProjectActionsin interfaceBuildStep- Overrides:
getProjectActionsin 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:
IOExceptionInterruptedException
-
perform
public void perform(Run<?, ?> build, @NonNull FilePath workspace, @NonNull EnvVars buildEnv, @NonNull Launcher launcher, @NonNull TaskListener listener) throws InterruptedException, IOException- Specified by:
performin interfaceSimpleBuildStep- Throws:
InterruptedExceptionIOException
-
copyFilesToDestination
public void copyFilesToDestination(Run<?, ?> build, FilePath workspace, String inputPath, String filemaskToCopy, Launcher launcher, TaskListener listener) throws IOException, InterruptedExceptionCopy files with given filemasks from input path relative to build into local build archive dir or artifact manager destination- Parameters:
build- The Jenkins runworkspace- Build workspaceinputPath- Base path for copy. Relative to build workspace.filemaskToCopy- List of Ant GLOB style filemasks to copy from dirs specified at inputPathMasklauncher- A way to start processeslistener- A place to send output- Throws:
IOException- thrown exceptionInterruptedException- thrown exception
-
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 local build file archive dir- Parameters:
build- The Jenkins runworkspace- Build workspaceinputPath- Base path for copy. Relative to build workspace.filemaskToCopy- List of Ant GLOB style filemasks to copy from dirs specified at inputPathMask- Throws:
IOException- thrown exceptionInterruptedException- thrown exception
-
archiveFilesToDestination
public void archiveFilesToDestination(Run<?, ?> build, FilePath workspace, String inputPath, String artifactsFilemask, Launcher launcher, TaskListener listener) throws IOException, InterruptedExceptionCopy files with given filemasks from input path relative to Artifact Manager- Parameters:
build- The Jenkins runworkspace- Build workspaceinputPath- Base path for copy. Relative to build workspace.artifactsFilemask- List of Ant GLOB style filemasks to copy from dirs specified at inputPathMasklauncher- A way to start processeslistener- A place to send output- Throws:
IOException- thrown exceptionInterruptedException- thrown exception
-
trimSuffix
-
getSuffix
-
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:
getRequiredMonitorServicein interfaceBuildStep
-
createAggregator
public hudson.matrix.MatrixAggregator createAggregator(hudson.matrix.MatrixBuild build, Launcher launcher, BuildListener listener) - Specified by:
createAggregatorin interfacehudson.matrix.MatrixAggregatable
-