Skip to content

Commit 5a6086c

Browse files
committed
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 <[email protected]>
1 parent dca95eb commit 5a6086c

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎packages/extra/ingress/tests/application_identity_test.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ release:
1414
tests:
1515
- it: drops the identity on every endpoint
1616
asserts:
17+
- lengthEqual:
18+
path: spec.podMetricsEndpoints
19+
count: 1
1720
- equal:
1821
path: spec.podMetricsEndpoints[0].metricRelabelConfigs
1922
value:

‎packages/system/monitoring-agents/tests/vmagent_application_identity_test.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ release:
1111
# all three (a placeholder when the pod has no lineage), so with
1212
# honorLabels false an exporter's own copy is renamed to exported_* and
1313
# dropped. The same rules live in the tenant vmagent of the monitoring
14-
# package and are pinned there by an identical suite.
14+
# package and are pinned there by the same assertions.
1515
tests:
1616
- it: every scrape gets the application identity class unless it names another
1717
asserts:

‎packages/system/monitoring/tests/vmagent_application_identity_test.yaml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ release:
66
namespace: tenant-foo
77

88
# Same rules as the cluster-wide vmagent in monitoring-agents, pinned there
9-
# by an identical suite; see it for why the placeholder and the drop exist.
9+
# by the same assertions; see that suite for why the placeholder and the
10+
# drop exist.
1011
tests:
1112
- it: every scrape gets the application identity class unless it names another
1213
asserts:

0 commit comments

Comments
 (0)