This is an automated email from the ASF dual-hosted git repository.
astefanutti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/main by this push:
new 9cf6c60 fix(e2e): Account for requeued and errored integration
reconciliations
9cf6c60 is described below
commit 9cf6c60aca8155bc07d1e93542fe7a11ad78d631
Author: Antonin Stefanutti <[email protected]>
AuthorDate: Wed Dec 15 13:25:23 2021 +0100
fix(e2e): Account for requeued and errored integration reconciliations
---
e2e/common/operator_metrics_test.go | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/e2e/common/operator_metrics_test.go
b/e2e/common/operator_metrics_test.go
index 62b181b..a3f12d1 100644
--- a/e2e/common/operator_metrics_test.go
+++ b/e2e/common/operator_metrics_test.go
@@ -269,7 +269,39 @@ func TestMetrics(t *testing.T) {
integrationReconciledCount :=
*integrationReconciled.Histogram.SampleCount
Expect(integrationReconciledCount).To(BeNumerically(">", 0))
-
Expect(integrationReconciliations).To(BeNumerically("==",
integrationReconciledCount))
+ integrationRequeued :=
getMetric(metrics["camel_k_reconciliation_duration_seconds"],
+ MatchFieldsP(IgnoreExtras, Fields{
+ "Label": ConsistOf(
+ label("group",
v1.SchemeGroupVersion.Group),
+ label("version",
v1.SchemeGroupVersion.Version),
+ label("kind", "Integration"),
+ label("namespace",
it.Namespace),
+ label("result", "Requeued"),
+ label("tag", ""),
+ ),
+ }))
+ integrationRequeuedCount := uint64(0)
+ if integrationRequeued != nil {
+ integrationRequeuedCount =
*integrationRequeued.Histogram.SampleCount
+ }
+
+ integrationErrored :=
getMetric(metrics["camel_k_reconciliation_duration_seconds"],
+ MatchFieldsP(IgnoreExtras, Fields{
+ "Label": ConsistOf(
+ label("group",
v1.SchemeGroupVersion.Group),
+ label("version",
v1.SchemeGroupVersion.Version),
+ label("kind", "Integration"),
+ label("namespace",
it.Namespace),
+ label("result", "Errored"),
+ label("tag", "PlatformError"),
+ ),
+ }))
+ integrationErroredCount := uint64(0)
+ if integrationErrored != nil {
+ integrationErroredCount =
*integrationErrored.Histogram.SampleCount
+ }
+
+
Expect(integrationReconciliations).To(BeNumerically("==",
integrationReconciledCount+integrationRequeuedCount+integrationErroredCount))
// Count the number of IntegrationKit reconciliations
integrationKitReconciliations, err :=
counter.Count(MatchFields(IgnoreExtras, Fields{