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:
-
Feldübersicht
-
Konstruktorübersicht
KonstruktorBeschreibungCoverageBuildAction
(Run<?, ?> owner, CoverageNode result, HealthReport healthReport) Creates a new instance ofCoverageBuildAction
.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 ofCoverageBuildAction
. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected CoverageJobAction
protected io.jenkins.plugins.util.AbstractXmlStream
<CoverageNode> formatChangeCoverage
(CoverageMetric metric) Returns a formatted and localized String representation of the change coverage for the specified metric (with respect to the reference build).Returns a formatted and localized String representation of the change coverage delta for the specified metric (with respect to the reference build).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).formatCoverage
(CoverageMetric metric) Returns a formatted and localized String representation of the coverage percentage for the specified metric (with respect to the reference build).formatDelta
(CoverageMetric metric) Returns a formatted and localized String representation of the delta for the specified metric (with respect to the reference build).Returns a formatted and localized String representation of an overview of the indirect coverage changes (with respect to the reference build).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).protected String
getChangeCoverage
(CoverageMetric coverageMetric) Gets thechange coverage
for the passed metric.getChangeCoverageDifference
(CoverageMetric coverageMetric) Returns the change coverage delta for the passed metric, i.e.getCoverage
(CoverageMetric coverageMetric) Returns theCoverage
for the specified metric.Returns the delta metrics, i.e.getIndirectCoverageChanges
(CoverageMetric coverageMetric) Gets theindirect coverage changes
for the passed metric.Returns the possible reference build that has been used to compute the coverage delta.Renders the reference build as HTML link.boolean
Returns whether a change coverage exists at all.boolean
hasChangeCoverage
(CoverageMetric coverageMetric) Returns whether a change coverage exists for the passedCoverageMetric
.boolean
Returns whether a change coverage delta metric for the specified metric exist.boolean
Checks whether any code changes have been detected no matter if the code coverage is affected or not.boolean
hasCoverage
(CoverageMetric coverageMetric) Returns whether aCoverage
for the specified metric exists.boolean
hasDelta
(CoverageMetric metric) Returns whether a delta metric for the specified metric exist.boolean
Returns whether indirect coverage changes exist at all.boolean
hasIndirectCoverageChanges
(CoverageMetric coverageMetric) Returns whether indirect coverage changes exist for the passedCoverageMetric
.protected Object
Von Klasse geerbte Methoden io.jenkins.plugins.util.BuildAction
getBuildActionFromHistoryStartingFrom, getOwner, getProjectActions, getResult, onAttached, onLoad
-
Felddetails
-
DETAILS_URL
Relative URL to the details of the code coverage results.- Siehe auch:
-
ICON
The coverage report icon.- Siehe auch:
-
-
Konstruktordetails
-
CoverageBuildAction
Creates a new instance ofCoverageBuildAction
.- Parameter:
owner
- the associated build that created the statisticsresult
- the coverage results to persist with this actionhealthReport
- 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 ofCoverageBuildAction
.- Parameter:
owner
- the associated build that created the statisticsresult
- the coverage results to persist with this actionhealthReport
- health reportreferenceBuildId
- the ID of the reference builddelta
- delta of this build's coverages with respect to the reference buildchangeCoverage
- the coverages filtered by changed lines of the associated change requestchangeCoverageDifference
- the delta of the coverages of the associated change request with respect to the reference buildindirectCoverageChanges
- the indirect coverage changes of the associated change request with respect to the reference build
-
-
Methodendetails
-
readResolve
- Setzt außer Kraft:
readResolve
in Klasseio.jenkins.plugins.util.BuildAction<CoverageNode>
-
getLineCoverage
-
getBranchCoverage
-
hasCoverage
Returns whether aCoverage
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
Returns theCoverage
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, elsefalse
-
hasChangeCoverage
Returns whether a change coverage exists for the passedCoverageMetric
.- Parameter:
coverageMetric
- The coverage metric- Gibt zurück:
true
if the change coverage exist for the metric, elsefalse
-
getChangeCoverage
Gets thechange 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, elsefalse
-
hasIndirectCoverageChanges
Returns whether indirect coverage changes exist for the passedCoverageMetric
.- Parameter:
coverageMetric
- The coverage metric- Gibt zurück:
true
if indirect coverage changes exist for the metric, elsefalse
-
getIndirectCoverageChanges
Gets theindirect coverage changes
for the passed metric.- Parameter:
coverageMetric
- The coverage metric- Gibt zurück:
- the indirect coverage changes
-
getReferenceBuild
Returns the possible reference build that has been used to compute the coverage delta.- Gibt zurück:
- the reference build, if available
-
getReferenceBuildLink
Renders the reference build as HTML link.- Gibt zurück:
- the reference build
- Siehe auch:
-
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
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
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
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
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
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
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
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
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
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
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
- Angegeben von:
createXmlStream
in Klasseio.jenkins.plugins.util.BuildAction<CoverageNode>
-
createProjectAction
- Angegeben von:
createProjectAction
in Klasseio.jenkins.plugins.util.BuildAction<CoverageNode>
-
getBuildResultBaseName
- Angegeben von:
getBuildResultBaseName
in Klasseio.jenkins.plugins.util.BuildAction<CoverageNode>
-
getBuildHealth
- Angegeben von:
getBuildHealth
in SchnittstelleHealthReportingAction
-
getTarget
- Angegeben von:
getTarget
in Schnittstelleorg.kohsuke.stapler.StaplerProxy
-
getIconFileName
- Angegeben von:
getIconFileName
in SchnittstelleAction
-
getDisplayName
- Angegeben von:
getDisplayName
in SchnittstelleAction
- Angegeben von:
getDisplayName
in SchnittstelleModelObject
-
getUrlName
- Angegeben von:
getUrlName
in SchnittstelleAction
-