From 5a6086c7a1756499f10fd869e20e7bd3c14a5e17 Mon Sep 17 00:00:00 2001 From: ZverGuy Date: Wed, 4 Nov 2026 04:30:32 +0700 Subject: [PATCH] test(monitoring): pin the endpoint count the ingress identity test relies on The ingress assertion reads only the first endpoint of each scrape, so a second endpoint added without the label drop would go unnoticed. Pinning the count makes such an addition fail the suite. Assisted-by: LLM Signed-off-by: ZverGuy --- packages/extra/ingress/tests/application_identity_test.yaml | 3 +++ .../tests/vmagent_application_identity_test.yaml | 2 +- .../monitoring/tests/vmagent_application_identity_test.yaml | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/extra/ingress/tests/application_identity_test.yaml b/packages/extra/ingress/tests/application_identity_test.yaml index e1be5ca4f..0e53a2756 100644 --- a/packages/extra/ingress/tests/application_identity_test.yaml +++ b/packages/extra/ingress/tests/application_identity_test.yaml @@ -14,6 +14,9 @@ release: tests: - it: drops the identity on every endpoint asserts: + - lengthEqual: + path: spec.podMetricsEndpoints + count: 1 - equal: path: spec.podMetricsEndpoints[0].metricRelabelConfigs value: diff --git a/packages/system/monitoring-agents/tests/vmagent_application_identity_test.yaml b/packages/system/monitoring-agents/tests/vmagent_application_identity_test.yaml index 601f1c926..b59f9e3ee 100644 --- a/packages/system/monitoring-agents/tests/vmagent_application_identity_test.yaml +++ b/packages/system/monitoring-agents/tests/vmagent_application_identity_test.yaml @@ -11,7 +11,7 @@ release: # all three (a placeholder when the pod has no lineage), so with # honorLabels false an exporter's own copy is renamed to exported_* and # dropped. The same rules live in the tenant vmagent of the monitoring -# package and are pinned there by an identical suite. +# package and are pinned there by the same assertions. tests: - it: every scrape gets the application identity class unless it names another asserts: diff --git a/packages/system/monitoring/tests/vmagent_application_identity_test.yaml b/packages/system/monitoring/tests/vmagent_application_identity_test.yaml index f36105f83..da14330de 100644 --- a/packages/system/monitoring/tests/vmagent_application_identity_test.yaml +++ b/packages/system/monitoring/tests/vmagent_application_identity_test.yaml @@ -6,7 +6,8 @@ release: namespace: tenant-foo # Same rules as the cluster-wide vmagent in monitoring-agents, pinned there -# by an identical suite; see it for why the placeholder and the drop exist. +# by the same assertions; see that suite for why the placeholder and the +# drop exist. tests: - it: every scrape gets the application identity class unless it names another asserts: