Skip to content

Commit 36d7f4d

Browse files
StarefossenCopilot
andcommitted
test(e2e): assert PodMonitor and PrometheusRule in CNPG E2E test
Add assertions for PodMonitor (with prometheus:tenant label and correct selector) and PrometheusRule creation in the postgres-cnpg-basic E2E test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a09c7a9 commit 36d7f4d

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

tests/e2e/postgres-cnpg-basic/chainsaw-test.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,32 @@ spec:
7676
metadata:
7777
name: mydb
7878
namespace: pg-cnpg-team
79+
- name: Assert PodMonitor created
80+
try:
81+
- assert:
82+
resource:
83+
apiVersion: monitoring.coreos.com/v1
84+
kind: PodMonitor
85+
metadata:
86+
name: mydb
87+
namespace: pg-cnpg-team
88+
labels:
89+
prometheus: tenant
90+
spec:
91+
selector:
92+
matchLabels:
93+
cnpg.io/cluster: mydb
94+
podMetricsEndpoints:
95+
- port: metrics
96+
- name: Assert PrometheusRule created
97+
try:
98+
- assert:
99+
resource:
100+
apiVersion: monitoring.coreos.com/v1
101+
kind: PrometheusRule
102+
metadata:
103+
name: mydb
104+
namespace: pg-cnpg-team
79105
- name: Assert engine annotation set
80106
try:
81107
- assert:

0 commit comments

Comments
 (0)