Skip to content

Commit f65152c

Browse files
committed
feat: added dbsync port validation
1 parent 334afe9 commit f65152c

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

test/e2e

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,13 @@ sleep $SLEEP_DURATION
186186
echo "Start validations ..."
187187

188188
RESOURCE=$(create_port 'CardanoNodePort' '"{\"network\":\"mainnet\",\"version\":\"stable\",\"throughputTier\":\"0\"}"')
189+
echo "Testing CardanoNodePort ..."
189190
node_port_expect $(echo "$(echo "$RESOURCE" | jq -r '.records[0].spec')" | jq -r '.authToken')
190191
echo "Node slot: $NODE_SLOT"
191192
NODE_SLOT=$(( NODE_SLOT - 120 ))
192193

193194
RESOURCE=$(create_port 'BlockfrostPort' '"{\"network\":\"mainnet\",\"throughputTier\":\"0\",\"operatorVersion\":\"1\"}"')
195+
echo "Testing Blockfrost ..."
194196
RESPONSE=$(http_port_expect "https://$(echo "$(echo "$RESOURCE" | jq -r '.records[0].spec')" | jq -r '.authToken').blockfrost-m1.demeter.run" "blocks/latest")
195197
SLOT="$(echo "$RESPONSE" | jq -r '.slot')"
196198
echo "Blockfrost slot: $SLOT"
@@ -201,6 +203,7 @@ if (( SLOT < NODE_SLOT )); then
201203
fi
202204

203205
RESOURCE=$(create_port 'KupoPort' '"{\"network\":\"mainnet\",\"throughputTier\":\"0\",\"pruneUtxo\":true,\"operatorVersion\":\"1\"}"')
206+
echo "Testing KupoPort ..."
204207
RESPONSE=$(http_port_expect "https://$(echo "$(echo "$RESOURCE" | jq -r '.records[0].spec')" | jq -r '.authToken').mainnet-v2.kupo-m1.demeter.run" "health")
205208
SLOT=$(echo "$RESPONSE" | grep "^kupo_most_recent_checkpoint " | awk '{print $2}')
206209
echo "Kupo slot: $SLOT"
@@ -211,6 +214,7 @@ if (( SLOT < NODE_SLOT )); then
211214
fi
212215

213216
RESOURCE=$(create_port 'OgmiosPort' '"{\"network\":\"mainnet\",\"throughputTier\":\"0\",\"version\":6}"')
217+
echo "Testing OgmiosPort ..."
214218
RESPONSE=$(http_port_expect "https://$(echo "$(echo "$RESOURCE" | jq -r '.records[0].spec')" | jq -r '.authToken').mainnet-v6.ogmios-m1.demeter.run" "health")
215219
SLOT="$(echo "$RESPONSE" | jq -r '.lastKnownTip.slot')"
216220
echo "Ogmios slot: $SLOT"
@@ -221,6 +225,7 @@ if (( SLOT < NODE_SLOT )); then
221225
fi
222226

223227
RESOURCE=$(create_port 'UtxoRpcPort' '"{\"network\":\"mainnet\",\"throughputTier\":\"0\",\"operatorVersion\":\"1\"}"')
228+
echo "Testing UtxoRpcPort ..."
224229
SLOT=$(utxorpc_port_expect $(echo "$RESOURCE" | jq -r '.records[0].spec' | jq -r '.authToken'))
225230
echo "UtxoRpc slot: $SLOT"
226231
if (( SLOT < NODE_SLOT )); then
@@ -229,8 +234,8 @@ if (( SLOT < NODE_SLOT )); then
229234
exit 1
230235
fi
231236

232-
233237
RESOURCE=$(create_port 'MumakPort' '"{\"network\":\"mainnet\",\"throughputTier\":\"0\"}"')
238+
echo "Testing MumakPort ..."
234239
export PGUSER=$(echo "$RESOURCE" | jq -r '.records[0].spec' | jq -r '.username')
235240
export PGPASSWORD=$(echo "$RESOURCE" | jq -r '.records[0].spec' | jq -r '.password')
236241
SLOT=$(psql --dbname=cardano-mainnet --host=mumak-m0.demeter.run -c "select slot from blocks order by slot desc limit 1" -t)
@@ -241,4 +246,16 @@ if (( SLOT < NODE_SLOT )); then
241246
exit 1
242247
fi
243248

249+
RESOURCE=$(create_port 'DbSyncPort' '"{\"network\":\"mainnet\",\"throughputTier\":\"0\"}"')
250+
echo "Testing DbSyncPort ..."
251+
export PGUSER=$(echo "$RESOURCE" | jq -r '.records[0].spec' | jq -r '.username')
252+
export PGPASSWORD=$(echo "$RESOURCE" | jq -r '.records[0].spec' | jq -r '.password')
253+
SLOT=$(psql --dbname=dbsync-mainnet --host=dbsync-v3.demeter.run -c "select slot_no from block where block_no is not null order by block_no desc limit 1" -t)
254+
echo "DbSync slot: $SLOT"
255+
if (( SLOT < NODE_SLOT )); then
256+
echo "Error: DbSyncPort is not in the chain tip"
257+
finish
258+
exit 1
259+
fi
260+
244261
finish

0 commit comments

Comments
 (0)