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 Linksymbol

  • Konstruktordetails Linksymbol

    • CoverageBuildAction Linksymbol

      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 Linksymbol

      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 Linksymbol

    • readResolve Linksymbol

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

      public Coverage getLineCoverage()
    • getBranchCoverage Linksymbol

      public Coverage getBranchCoverage()
    • hasCoverage Linksymbol

      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 Linksymbol

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

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

      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 Linksymbol

      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 Linksymbol

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

      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 Linksymbol

      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 Linksymbol

      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 Linksymbol

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

      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 Linksymbol

      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 Linksymbol

      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 Linksymbol

      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 Linksymbol

      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 Linksymbol

      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 Linksymbol

      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 Linksymbol

      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 Linksymbol

      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 Linksymbol

      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 Linksymbol

      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 Linksymbol

      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 Linksymbol

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

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

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

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

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

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

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

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