Skip to content

Commit

Permalink
Add test cluster setup
Browse files Browse the repository at this point in the history
  • Loading branch information
antejavor committed May 15, 2024
1 parent 6ae4613 commit 51b0cb5
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 12 deletions.
12 changes: 0 additions & 12 deletions charts/memgraph-high-availability/templates/serviceaccount.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: batch/v1
kind: Job
metadata:
name: "{{ .Release.Name }}-memgraph-test-cluster-setup"
labels:
{{- include "memgraph.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
template:
metadata:
labels:
app: memgraph
spec:
containers:
- name: memgraph-test-cluster-setup
image: memgraph/memgraph:2.16.0
command: ["/bin/sh", "-c"]
args:
- |
check_mgconsole() {
local host=$1
local command=$2
local expected=$3
result=$(echo $command | mgconsole --host $host --port 7687)
if [[ $result != *$expected* ]]; then
echo "Unexpected mgconsole result for host $host:"
echo $result
exit 1
fi
}
check_mgconsole "memgraph-coordinator-1.default.svc.cluster.local" "SHOW INSTANCES;" "coordinator_1"
check_mgconsole "memgraph-coordinator-2.default.svc.cluster.local" "SHOW INSTANCES;" "coordinator_2"
check_mgconsole "memgraph-coordinator-3.default.svc.cluster.local" "SHOW INSTANCES;" "coordinator_3"
check_mgconsole "memgraph-data-0.default.svc.cluster.local" "RETURN 0;" "0"
check_mgconsole "memgraph-data-1.default.svc.cluster.local" "RETURN 0;" "0"
restartPolicy: Never
backoffLimit: 4

0 comments on commit 51b0cb5

Please sign in to comment.