Class RobotPublisher

    • 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 dir
        outputPath - Path to Robot Framework's output files
        outputFileName - Name of Robot output xml
        disableArchiveOutput - Disable Archiving output xml file to server
        reportFileName - Name of Robot report html
        logFileName - Name of Robot log html
        passThreshold - Threshold of test pass percentage for successful builds
        unstableThreshold - Threshold of test pass percentage for unstable builds
        onlyCritical - True if only critical tests are included in pass percentage
        otherFiles - Other files to be saved
        enableCache - 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
      • 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 run
        inputPath - Base path for copy. Relative to build workspace.
        filemaskToCopy - List of Ant GLOB style filemasks to copy from dirs specified at inputPathMask
        workspace - Build workspace
        Throws:
        IOException - thrown exception
        InterruptedException - 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 evaluated
        result - Results associated to build
        Returns:
        Result of build
      • createAggregator

        public hudson.matrix.MatrixAggregator createAggregator​(hudson.matrix.MatrixBuild build,
                                                               Launcher launcher,
                                                               BuildListener listener)
        Specified by:
        createAggregator in interface hudson.matrix.MatrixAggregatable