Klasse CoverageBuildAction

java.lang.Object
io.jenkins.plugins.util.BuildAction<CoverageNode>
io.jenkins.plugins.coverage.model.CoverageBuildAction
Alle implementierten Schnittstellen:
Action, HealthReportingAction, ModelObject, Serializable, RunAction2, SimpleBuildStep.LastBuildAction, org.kohsuke.stapler.StaplerProxy

public class CoverageBuildAction extends io.jenkins.plugins.util.BuildAction<CoverageNode> implements HealthReportingAction, org.kohsuke.stapler.StaplerProxy
Controls the life cycle of the coverage results in a job. This action persists the results of a build and displays a summary on the build page. The actual visualization of the results is defined in the matching summary.jelly file. This action also provides access to the coverage details: these are rendered using a new view instance.
Autor:
Ullrich Hafner
Siehe auch:
  • Felddetails

  • Konstruktordetails

    • CoverageBuildAction

      public CoverageBuildAction(Run<?,?> owner, CoverageNode result, HealthReport healthReport)
      Creates a new instance of CoverageBuildAction.
      Parameter:
      owner - the associated build that created the statistics
      result - the coverage results to persist with this action
      healthReport - health report
    • CoverageBuildAction

      public CoverageBuildAction(Run<?,?> owner, CoverageNode result, HealthReport healthReport, String referenceBuildId, SortedMap<CoverageMetric,CoveragePercentage> delta, SortedMap<CoverageMetric,CoveragePercentage> changeCoverage, SortedMap<CoverageMetric,CoveragePercentage> changeCoverageDifference, SortedMap<CoverageMetric,CoveragePercentage> indirectCoverageChanges)
      Creates a new instance of CoverageBuildAction.
      Parameter:
      owner - the associated build that created the statistics
      result - the coverage results to persist with this action
      healthReport - health report
      referenceBuildId - the ID of the reference build
      delta - delta of this build's coverages with respect to the reference build
      changeCoverage - the coverages filtered by changed lines of the associated change request
      changeCoverageDifference - the delta of the coverages of the associated change request with respect to the reference build
      indirectCoverageChanges - the indirect coverage changes of the associated change request with respect to the reference build
  • Methodendetails

    • readResolve

      protected Object readResolve()
      Setzt außer Kraft:
      readResolve in Klasse io.jenkins.plugins.util.BuildAction<CoverageNode>
    • getLineCoverage

      public Coverage getLineCoverage()
    • getBranchCoverage

      public Coverage getBranchCoverage()
    • hasCoverage

      public boolean hasCoverage(CoverageMetric coverageMetric)
      Returns whether a Coverage for the specified metric exists.
      Parameter:
      coverageMetric - the coverage metric
      Gibt zurück:
      true if a coverage is available for the specified metric, false otherwise
    • getCoverage

      public Coverage getCoverage(CoverageMetric coverageMetric)
      Returns the Coverage for the specified metric.
      Parameter:
      coverageMetric - the coverage metric
      Gibt zurück:
      the coverage
    • hasChangeCoverage

      public boolean hasChangeCoverage()
      Returns whether a change coverage exists at all.
      Gibt zurück:
      true if the change coverage exist, else false
    • hasChangeCoverage

      public boolean hasChangeCoverage(CoverageMetric coverageMetric)
      Returns whether a change coverage exists for the passed CoverageMetric.
      Parameter:
      coverageMetric - The coverage metric
      Gibt zurück:
      true if the change coverage exist for the metric, else false
    • getChangeCoverage

      public Coverage getChangeCoverage(CoverageMetric coverageMetric)
      Gets the change coverage for the passed metric.
      Parameter:
      coverageMetric - The coverage metric
      Gibt zurück:
      the change coverage
    • hasIndirectCoverageChanges

      public boolean hasIndirectCoverageChanges()
      Returns whether indirect coverage changes exist at all.
      Gibt zurück:
      true if indirect coverage changes exist, else false
    • hasIndirectCoverageChanges

      public boolean hasIndirectCoverageChanges(CoverageMetric coverageMetric)
      Returns whether indirect coverage changes exist for the passed CoverageMetric.
      Parameter:
      coverageMetric - The coverage metric
      Gibt zurück:
      true if indirect coverage changes exist for the metric, else false
    • getIndirectCoverageChanges

      public Coverage getIndirectCoverageChanges(CoverageMetric coverageMetric)
      Gets the indirect coverage changes for the passed metric.
      Parameter:
      coverageMetric - The coverage metric
      Gibt zurück:
      the indirect coverage changes
    • getReferenceBuild

      public Optional<Run<?,?>> getReferenceBuild()
      Returns the possible reference build that has been used to compute the coverage delta.
      Gibt zurück:
      the reference build, if available
    • getReferenceBuildLink

      public String getReferenceBuildLink()
      Renders the reference build as HTML link.
      Gibt zurück:
      the reference build
      Siehe auch:
    • getDifference

      public SortedMap<CoverageMetric,CoveragePercentage> getDifference()
      Returns the delta metrics, i.e. the coverage results of the current build minus the same results of the reference build.
      Gibt zurück:
      the delta for each available coverage metric
    • hasDelta

      public boolean hasDelta(CoverageMetric metric)
      Returns whether a delta metric for the specified metric exist.
      Parameter:
      metric - the metric to check
      Gibt zurück:
      true if a delta is available for the specified metric
    • formatDelta

      public String formatDelta(CoverageMetric metric)
      Returns a formatted and localized String representation of the delta for the specified metric (with respect to the reference build).
      Parameter:
      metric - the metric to get the delta for
      Gibt zurück:
      the delta metric
    • formatChangeCoverage

      public String formatChangeCoverage(CoverageMetric metric)
      Returns a formatted and localized String representation of the change coverage for the specified metric (with respect to the reference build).
      Parameter:
      metric - the metric to get the change coverage for
      Gibt zurück:
      the change coverage metric
    • formatIndirectCoverageChanges

      public String formatIndirectCoverageChanges(CoverageMetric metric)
      Returns a formatted and localized String representation of an overview of the indirect coverage changes (with respect to the reference build).
      Parameter:
      metric - the metric to get the indirect coverage changes for
      Gibt zurück:
      the formatted representation of the indirect coverage changes
    • getChangeCoverageDifference

      public CoveragePercentage getChangeCoverageDifference(CoverageMetric coverageMetric)
      Returns the change coverage delta for the passed metric, i.e. the coverage results of the current build minus the same results of the reference build.
      Parameter:
      coverageMetric - The change coverage metric
      Gibt zurück:
      the delta for each available coverage metric
    • hasChangeCoverageDifference

      public boolean hasChangeCoverageDifference(CoverageMetric metric)
      Returns whether a change coverage delta metric for the specified metric exist.
      Parameter:
      metric - the metric to check
      Gibt zurück:
      true if a delta is available for the specified metric
    • hasCodeChanges

      public boolean hasCodeChanges()
      Checks whether any code changes have been detected no matter if the code coverage is affected or not.
      Gibt zurück:
      true whether code changes have been detected
    • formatChangeCoverageDifference

      public String formatChangeCoverageDifference(CoverageMetric metric)
      Returns a formatted and localized String representation of the change coverage delta for the specified metric (with respect to the reference build).
      Parameter:
      metric - the metric to get the delta for
      Gibt zurück:
      the delta metric
    • formatChangeCoverageOverview

      public String formatChangeCoverageOverview()
      Returns a formatted and localized String representation of an overview of how many lines and files are affected by the change coverage (with respect to the reference build).
      Gibt zurück:
      the formatted representation of the change coverage
    • formatIndirectCoverageChangesOverview

      public String formatIndirectCoverageChangesOverview()
      Returns a formatted and localized String representation of an overview of how many lines and files are affected by the indirect coverage changes (with respect to the reference build).
      Gibt zurück:
      the formatted representation of the indirect coverage changes
    • formatCoverage

      public String formatCoverage(CoverageMetric metric)
      Returns a formatted and localized String representation of the coverage percentage for the specified metric (with respect to the reference build).
      Parameter:
      metric - the metric to get the coverage percentage for
      Gibt zurück:
      the delta metric
    • createXmlStream

      protected io.jenkins.plugins.util.AbstractXmlStream<CoverageNode> createXmlStream()
      Angegeben von:
      createXmlStream in Klasse io.jenkins.plugins.util.BuildAction<CoverageNode>
    • createProjectAction

      protected CoverageJobAction createProjectAction()
      Angegeben von:
      createProjectAction in Klasse io.jenkins.plugins.util.BuildAction<CoverageNode>
    • getBuildResultBaseName

      protected String getBuildResultBaseName()
      Angegeben von:
      getBuildResultBaseName in Klasse io.jenkins.plugins.util.BuildAction<CoverageNode>
    • getBuildHealth

      public HealthReport getBuildHealth()
      Angegeben von:
      getBuildHealth in Schnittstelle HealthReportingAction
    • getTarget

      public CoverageViewModel getTarget()
      Angegeben von:
      getTarget in Schnittstelle org.kohsuke.stapler.StaplerProxy
    • getIconFileName

      @CheckForNull public String getIconFileName()
      Angegeben von:
      getIconFileName in Schnittstelle Action
    • getDisplayName

      @NonNull public String getDisplayName()
      Angegeben von:
      getDisplayName in Schnittstelle Action
      Angegeben von:
      getDisplayName in Schnittstelle ModelObject
    • getUrlName

      @NonNull public String getUrlName()
      Angegeben von:
      getUrlName in Schnittstelle Action