Klasse CoverageRecorder

Alle implementierten Schnittstellen:
ExtensionPoint, Describable<Publisher>, BuildStep

public class CoverageRecorder extends Recorder
A pipeline Step or Freestyle or Maven Recorder that reads and parses coverage results in a build and adds the results to the persisted build results.

Stores the created issues in a Node. This result is then attached to the build by registering a CoverageBuildAction.

Autor:
Ullrich Hafner
  • Konstruktordetails

    • CoverageRecorder

      @DataBoundConstructor public CoverageRecorder()
      Creates a new instance of CoverageRecorder.
  • Methodendetails

    • setTools

      @DataBoundSetter public void setTools(List<CoverageTool> tools)
      Sets the coverage tools that will scan files and create coverage reports.
      Parameter:
      tools - the coverage tools
    • getTools

      public List<CoverageTool> getTools()
    • setQualityGates

      @DataBoundSetter public void setQualityGates(List<CoverageQualityGate> qualityGates)
      Defines the optional list of quality gates.
      Parameter:
      qualityGates - the quality gates
    • getQualityGates

      public List<CoverageQualityGate> getQualityGates()
    • setId

      @DataBoundSetter public void setId(String id)
      Overrides the default ID of the results. The ID is used as URL of the results and as identifier in UI elements. If no ID is given, then the default ID "coverage".
      Parameter:
      id - the ID of the results
      Siehe auch:
    • getId

      public String getId()
    • getActualId

      public String getActualId()
      Returns the actual ID of the results. If no user-defined ID is given, then the default ID DEFAULT_ID is returned.
      Gibt zurück:
      the ID
      Siehe auch:
    • setName

      @DataBoundSetter public void setName(String name)
      Overrides the name of the results. The name is used for all labels in the UI. If no name is given, then the default name is used.
      Parameter:
      name - the name of the results
      Siehe auch:
    • getName

      public String getName()
    • setSkipPublishingChecks

      @DataBoundSetter public void setSkipPublishingChecks(boolean skipPublishingChecks)
      Sets whether publishing checks should be skipped or not.
      Parameter:
      skipPublishingChecks - true if publishing checks should be skipped, false otherwise
    • isSkipPublishingChecks

      public boolean isSkipPublishingChecks()
    • setChecksName

      @DataBoundSetter public void setChecksName(String checksName)
      Changes the default name for the SCM checks report.
      Parameter:
      checksName - the name that should be used for the SCM checks report
    • getChecksName

      public String getChecksName()
    • setChecksAnnotationScope

      @DataBoundSetter public void setChecksAnnotationScope(CoverageRecorder.ChecksAnnotationScope checksAnnotationScope)
      Sets the scope of the annotations that should be published to SCM checks.
      Parameter:
      checksAnnotationScope - the scope to use
    • getChecksAnnotationScope

      public CoverageRecorder.ChecksAnnotationScope getChecksAnnotationScope()
    • setSkipSymbolicLinks

      @DataBoundSetter public void setSkipSymbolicLinks(boolean skipSymbolicLinks)
      Specify if traversal of symbolic links will be skipped during directory scanning for coverage reports.
      Parameter:
      skipSymbolicLinks - if symbolic links should be skipped during directory scanning
    • isSkipSymbolicLinks

      public boolean isSkipSymbolicLinks()
    • setIgnoreParsingErrors

      @DataBoundSetter public void setIgnoreParsingErrors(boolean ignoreParsingErrors)
      Specify if parsing errors should be ignored and logged instead of throwing an exception.
      Parameter:
      ignoreParsingErrors - if parsing errors should be ignored and logged instead of throwing an exception
    • isIgnoreParsingErrors

      public boolean isIgnoreParsingErrors()
    • setFailOnError

      @DataBoundSetter public void setFailOnError(boolean failOnError)
      Determines whether to fail the build on errors during the step of recording coverage reports.
      Parameter:
      failOnError - if true then the build will be failed on errors, false then errors are only reported in the UI
    • isFailOnError

      public boolean isFailOnError()
    • setEnabledForFailure

      @DataBoundSetter public void setEnabledForFailure(boolean enabledForFailure)
      Returns whether recording should be enabled for failed builds as well.
      Parameter:
      enabledForFailure - true if recording should be enabled for failed builds as well, false if recording is enabled for successful or unstable builds only
    • isEnabledForFailure

      public boolean isEnabledForFailure()
    • setSourceCodeEncoding

      @DataBoundSetter public void setSourceCodeEncoding(String sourceCodeEncoding)
      Sets the encoding to use to read source files.
      Parameter:
      sourceCodeEncoding - the encoding, e.g. "ISO-8859-1"
    • getSourceCodeEncoding

      public String getSourceCodeEncoding()
    • setSourceDirectories

      @DataBoundSetter public void setSourceDirectories(List<io.jenkins.plugins.prism.SourceCodeDirectory> sourceCodeDirectories)
      Sets the paths to the directories that contain the source code. If not relative and thus not part of the workspace, then these directories need to be added in Jenkins global configuration to prevent accessing of forbidden resources.
      Parameter:
      sourceCodeDirectories - directories containing the source code
    • getSourceDirectories

      public Set<io.jenkins.plugins.prism.SourceCodeDirectory> getSourceDirectories()
    • setSourceCodeRetention

      @DataBoundSetter public void setSourceCodeRetention(io.jenkins.plugins.prism.SourceCodeRetention sourceCodeRetention)
      Defines the retention strategy for source code files.
      Parameter:
      sourceCodeRetention - the retention strategy for source code files
    • getSourceCodeRetention

      public io.jenkins.plugins.prism.SourceCodeRetention getSourceCodeRetention()
    • setScm

      @DataBoundSetter public void setScm(String scm)
      Sets the SCM that should be used to find the reference build for. The reference recorder will select the SCM based on a substring comparison, there is no need to specify the full name.
      Parameter:
      scm - the ID of the SCM to use (a substring of the full ID)
    • getScm

      public String getScm()
    • getRequiredMonitorService

      public BuildStepMonitor getRequiredMonitorService()
    • perform

      public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException
      Angegeben von:
      perform in Schnittstelle BuildStep
      Setzt außer Kraft:
      perform in Klasse BuildStepCompatibilityLayer
      Löst aus:
      InterruptedException
      IOException
    • getDescriptor

      public CoverageRecorder.Descriptor getDescriptor()
      Angegeben von:
      getDescriptor in Schnittstelle Describable<Publisher>
      Setzt außer Kraft:
      getDescriptor in Klasse Recorder