BuildFailureOnMetric
A build failure condition failing build on metric change.
Example. Fail build if the size of its artifacts decreases by 10% comparing to the last successful build.
buildType {
// Other Build Type settings ...
failureConditions {
// Other Failure Conditions ...
failOnMetricChange {
metric = BuildFailureOnMetric.MetricType.ARTIFACT_SIZE
threshold = 10
units = BuildFailureOnMetric.MetricUnit.PERCENTS
comparison = BuildFailureOnMetric.MetricComparison.LESS
compareTo = build {
buildRule = lastSuccessful()
}
}
Content copied to clipboard }
}
Example. Fail build if number of ignored tests exceeds 100.
buildType {
// Other Build Type settings ...
failureConditions {
// Other Failure Conditions ...
failOnMetricChange {
metric = BuildFailureOnMetric.MetricType.TEST_IGNORED_COUNT
threshold = 100
units = BuildFailureOnMetric.MetricUnit.DEFAULT_UNIT
comparison = BuildFailureOnMetric.MetricComparison.MORE
compareTo = value()
}
Content copied to clipboard }
}
See also
Constructors
Types
A type of metric change
A type of the metric
Specifies how to treat the threshold specified in the failure condition
Functions
The metric value in the build should be compared to the metric value from a build matched by the rule
Copies parameters of this object to the specified target
Creates an instance of this build feature via reflection using a no argument constructor, used during copying. Throws an error if this class doesn't have a default constructor. Subclasses can override it to create an instance without using a default constructor.
Validates this object and reports found errors to the provided consumer
The metric value in the build should be compared to the threshold