File tree Expand file tree Collapse file tree 2 files changed +66
-0
lines changed
tests/templates/kuttl/spark-connect Expand file tree Collapse file tree 2 files changed +66
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion : kuttl.dev/v1beta1
3+ kind : TestAssert
4+ metadata :
5+ name : metrics
6+ commands :
7+ - script : kubectl exec -n $NAMESPACE python -- python /test-scripts/metrics.py
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion : kuttl.dev/v1beta1
3+ kind : TestStep
4+ metadata :
5+ name : install-test-container
6+ timeout : 300
7+ ---
8+ apiVersion : v1
9+ kind : ConfigMap
10+ metadata :
11+ name : test-scripts
12+ data :
13+ metrics.py : |
14+ import sys
15+ import logging
16+ import requests
17+
18+ if __name__ == "__main__":
19+ LOG_LEVEL = "DEBUG" # if args.debug else 'INFO'
20+ logging.basicConfig(
21+ level=LOG_LEVEL,
22+ format="%(asctime)s %(levelname)s: %(message)s",
23+ stream=sys.stdout,
24+ )
25+
26+ response = requests.get("http://spark-connect-server-metrics:4040/metrics/prometheus")
27+
28+ assert response.status_code == 200, (
29+ f"Expected HTTP return code 200 from the metrics endpoint but got [{response.status_code}]"
30+ )
31+
32+ assert "BlockManager_memory_remainingOnHeapMem_MB_Value" in response.text, (
33+ "Expected metric [BlockManager_memory_remainingOnHeapMem_MB_Value] not found"
34+ )
35+ ---
36+ apiVersion : v1
37+ kind : Pod
38+ metadata :
39+ name : python
40+ spec :
41+ containers :
42+ - name : tools
43+ image : oci.stackable.tech/sdp/testing-tools:0.2.0-stackable0.0.0-dev
44+ stdin : true
45+ tty : true
46+ resources :
47+ requests :
48+ memory : " 128Mi"
49+ cpu : " 512m"
50+ limits :
51+ memory : " 128Mi"
52+ cpu : " 1"
53+ volumeMounts :
54+ - name : test-scripts
55+ mountPath : /test-scripts
56+ volumes :
57+ - name : test-scripts
58+ configMap :
59+ name : test-scripts
You can’t perform that action at this time.
0 commit comments