Skip to content

Commit 046452b

Browse files
committed
explicitly confirm grafana dashboard was created
the test script was previously doing a basic HTTP check on the grafana port to determine that it was alive. this upgrades that test to explicitly confirm that not only is grafana alive, but that the CNPG dashboard was created successfully.
1 parent bd60d33 commit 046452b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

test-1-setup.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ for region in eu us; do
7979
[ "${CONTAINER_METRICS}" -ge 1 ] && \
8080
pass "${region}: Container metrics available (${CONTAINER_METRICS})" || fail "${region}: Container metrics missing"
8181

82-
# Test Grafana HTTP
82+
# Test Grafana dashboard
8383
GPORT=3000; [ "$region" = "us" ] && GPORT=3001
8484
kubectl port-forward -n grafana service/grafana-service ${GPORT}:3000 --context "${CTX}" &
8585
sleep 3
8686

87-
GSTATUS=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:${GPORT}/login || echo "000")
88-
[ "${GSTATUS}" = "200" ] && \
89-
pass "${region}: Grafana HTTP" || fail "${region}: Grafana HTTP failed"
87+
DASHBOARD_COUNT=$(curl -s -u admin:admin "http://localhost:${GPORT}/api/search?query=cloudnativepg" | jq 'length' 2>/dev/null || echo "0")
88+
[ "${DASHBOARD_COUNT}" -ge 1 ] && \
89+
pass "${region}: CloudNativePG dashboard exists" || fail "${region}: CloudNativePG dashboard missing"
9090
done
9191

9292
cleanup

0 commit comments

Comments
 (0)