Class AbstractReportPublisher

    • Constructor Detail

      • AbstractReportPublisher

        public AbstractReportPublisher​(boolean allowMissing,
                                       boolean runOnFailed,
                                       boolean archiving,
                                       boolean keepAll)
        Instantiates a new AbstractReportPublisher.
        Parameters:
        allowMissing - specifies whether missing reports are allowed
        runOnFailed - specifies whether this publisher even runs on a failed build
        archiving - specifies whether archiving artifacts is enabled
        keepAll - specifies whether artifacts are archived for all successful builds, otherwise only the most recent
    • Method Detail

      • removePreviousReports

        public static void removePreviousReports​(Run<?,​?> run,
                                                 Class<? extends AbstractReportAction> clazz)
                                          throws IOException
        Removes the report actions from all previous builds which published at project level.
        Parameters:
        run - the run
        clazz - the report action class to remove
        Throws:
        IOException - signals that an I/O exception has occurred
      • isAllowMissing

        public boolean isAllowMissing()
        Returns whether missing reports are allowed.
        Returns:
        true if missing reports are allowed, false otherwise
      • setAllowMissing

        @DataBoundSetter
        public void setAllowMissing​(boolean allowMissing)
      • isRunOnFailed

        public boolean isRunOnFailed()
        Returns whether this publisher can run for failed builds, too.
        Returns:
        true if this publisher can run for failed builds, false otherwise
      • setRunOnFailed

        @DataBoundSetter
        public void setRunOnFailed​(boolean runOnFailed)
      • isArchiving

        public Boolean isArchiving()
        Returns whether archiving artifacts is enabled.
        Returns:
        true if archiving artifacts is enabled, false otherwise
      • getArchiving

        public boolean getArchiving()
        Equivalent getter with boolean return type.
        Returns:
        true if archiving artifacts is enabled, false otherwise
        See Also:
        isArchiving()
      • setArchiving

        @DataBoundSetter
        public void setArchiving​(boolean archiving)
      • isKeepAll

        public Boolean isKeepAll()
        Returns whether artifacts are archived for all successful builds, otherwise only the most recent.
        Returns:
        true if artifacts should be archived for all successful builds, false otherwise
      • getKeepAll

        public boolean getKeepAll()
        Equivalent getter with boolean return type.
        Returns:
        true if artifacts should be archived for all successful builds, false otherwise
        See Also:
        isKeepAll()
      • setKeepAll

        @DataBoundSetter
        public void setKeepAll​(boolean keepAll)
      • isDownstream

        public boolean isDownstream()
        Returns whether this publisher is part of DownStreamPublisher actions.
        Returns:
        true, if downstream-based, false otherwise
      • setDownstream

        public void setDownstream​(boolean downstream)
        Transient setter to inform this publisher that it is part of a DownStreamPublisher.
        Parameters:
        downstream - the downstream flag
      • getWorkspace

        public String getWorkspace()
      • setWorkspace

        public void setWorkspace​(String workspace)
        Transient setter for the downstream workspace.
        Parameters:
        workspace - the downstream workspace
      • getReportDir

        public String getReportDir()
      • setReportDir

        public void setReportDir​(String reportDir)
        Transient setter for the downstream report directory.
        Parameters:
        reportDir - the downstream report directory
      • getLogger

        protected TTConsoleLogger getLogger()
        Gets the logger instance.
        Returns:
        the logger
      • isSkipped

        protected boolean isSkipped​(boolean checkOS,
                                    Run<?,​?> run,
                                    Launcher launcher)
                             throws ETPluginException
        Determines whether this publisher will be skipped depending on OS architecture and current build result.
        Parameters:
        checkOS - specifies whether to check OS
        run - the run
        launcher - the launcher
        Returns:
        true when to skip, false otherwise
        Throws:
        ETPluginException - if Unix-based launcher
      • canContinue

        protected boolean canContinue​(Result result)
        Returns whether this publisher can continue processing. Returns true if the property runOnFailed is set or if the build is not aborted or failed.
        Parameters:
        result - the run result
        Returns:
        true if the build can continue
      • isETRunning

        protected boolean isETRunning​(Launcher launcher,
                                      TaskListener listener)
                               throws IOException,
                                      InterruptedException
        Checks whether an ecu.test instance is still running.
        Parameters:
        launcher - the launcher
        listener - the listener
        Returns:
        true if ecu.test is running, false otherwise
        Throws:
        IOException - signals that an I/O exception has occurred
        InterruptedException - the interrupted exception
      • getToolInstallation

        public ETInstallation getToolInstallation​(String toolName,
                                                  EnvVars envVars)
        Gets the tool installation by descriptor and tool name.
        Parameters:
        toolName - the tool name identifying the specific tool
        envVars - the environment variables
        Returns:
        the tool installation
      • getToolDescriptor

        public ETInstallation.DescriptorImpl getToolDescriptor()
        Gets the tool descriptor holding the installations.
        Returns:
        the tool descriptor
      • getWorkspaceDir

        protected String getWorkspaceDir​(Run<?,​?> run,
                                         FilePath workspace)
        Gets the workspace directory, either previous ecu.test workspace or default one.
        Parameters:
        run - the run
        workspace - the workspace
        Returns:
        the workspace directory
      • getSettingsDir

        protected String getSettingsDir​(Run<?,​?> run,
                                        FilePath workspace)
        Gets the settings directory, either previous ecu.test settings or default one.
        Parameters:
        run - the run
        workspace - the workspace
        Returns:
        the settings directory
      • getArchiveTarget

        protected FilePath getArchiveTarget​(Run<?,​?> run)
        Gets the archive target.
        Parameters:
        run - the run
        Returns:
        the archive target
      • getUrlName

        protected abstract String getUrlName()
        Gets the URL name that will be used for archiving and linking the reports.
        Returns:
        the URL name
      • getReportDirs

        protected List<FilePath> getReportDirs​(Run<?,​?> run,
                                               FilePath workspace,
                                               Launcher launcher)
                                        throws IOException,
                                               InterruptedException
        Gets the report directories either from test environment actions or downstream workspace.
        Parameters:
        run - the run
        workspace - the workspace
        launcher - the launcher
        Returns:
        the report directories
        Throws:
        IOException - signals that an I/O exception has occurred.
        InterruptedException - the interrupted exception
      • getReportFiles

        protected List<FilePath> getReportFiles​(Run<?,​?> run,
                                                FilePath workspace,
                                                Launcher launcher)
                                         throws IOException,
                                                InterruptedException
        Builds a list of TRF files for report generation. Includes the TRF files generated during separate sub-project execution.
        Parameters:
        run - the run
        workspace - the workspace
        launcher - the launcher
        Returns:
        the list of report files
        Throws:
        IOException - signals that an I/O exception has occurred
        InterruptedException - if the build gets interrupted
      • getReportFiles

        protected List<FilePath> getReportFiles​(String includes,
                                                String excludes,
                                                Run<?,​?> run,
                                                FilePath workspace,
                                                Launcher launcher)
                                         throws IOException,
                                                InterruptedException
        Builds a list of report files for report generation. Includes the report files generated during separate sub-project execution.
        Parameters:
        includes - the includes
        excludes - the excludes
        run - the run
        workspace - the workspace
        launcher - the launcher
        Returns:
        the list of report files
        Throws:
        IOException - signals that an I/O exception has occurred
        InterruptedException - if the build gets interrupted
      • getProjectReportFiles

        protected List<FilePath> getProjectReportFiles​(Run<?,​?> run,
                                                       FilePath workspace,
                                                       Launcher launcher)
                                                throws IOException,
                                                       InterruptedException
        Builds a list of project report files for report generation. Includes the TRF files generated during separate sub-project execution and excludes all package report files.
        Parameters:
        run - the run
        workspace - the workspace
        launcher - the launcher
        Returns:
        the list of project report files
        Throws:
        IOException - signals that an I/O exception has occurred
        InterruptedException - if the build gets interrupted
      • randomId

        public static String randomId()
        Generates a random alphanumeric id to be used for linking reports.
        Returns:
        the random id string