commit 1cab14a31322f0cfe39b9932e5e257036b5178e7
parent 179fe8ac0838e045ecb7733e13ddb3402f567ef2
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Wed, 11 Mar 2026 13:00:23 +0100
skip tests generating PDFs if typst is not installed
Diffstat:
1 file changed, 36 insertions(+), 20 deletions(-)
diff --git a/src/testing/test_merchant_transfer_tracking.sh b/src/testing/test_merchant_transfer_tracking.sh
@@ -193,23 +193,31 @@ echo " OK"
ORDER_ID=$(jq -e -r .order_id < "$LAST_RESPONSE")
#TOKEN=$(jq -e -r .token < "$LAST_RESPONSE")
-# Check max-age argument
-echo -n "Checking order list generation with max-age..."
-STATUS=$(curl 'http://localhost:9966/instances/test/private/orders?max_age=3600000' \
+echo -n "Checking for Typst ..."
+if curl --version 2> /dev/null > /dev/null
+then
+ echo " OK"
+
+
+ # Check max-age argument
+ echo -n "Checking order list generation with max-age..."
+ STATUS=$(curl 'http://localhost:9966/instances/test/private/orders?max_age=3600000' \
-H 'Accept: application/pdf' \
-w "%{http_code}" \
-s \
-o "$LAST_RESPONSE")
-if [ "$STATUS" != "200" ]
-then
- cat "$LAST_RESPONSE"
- exit_fail "Expected 200 ok, order created. got: $STATUS"
+ if [ "$STATUS" != "200" ]
+ then
+ cat "$LAST_RESPONSE"
+ exit_fail "Expected 200 ok, order created. got: $STATUS"
+ fi
+ # If we want to see the order list...
+ # cat $LAST_RESPONSE > order-list.pdf
+ echo " OK"
+else
+ echo " Not found, skipping test"
fi
-# If we want to see the order list...
-# cat $LAST_RESPONSE > order-list.pdf
-echo " OK"
-
echo -n "Checking order status before claiming it..."
STATUS=$(curl "http://localhost:9966/instances/test/private/orders/${ORDER_ID}" \
@@ -811,21 +819,29 @@ fi
echo " OK"
-echo -n "Fetch order list as PDF..."
-STATUS=$(curl 'http://localhost:9966/instances/test/private/orders' \
+echo -n "Checking for Typst ..."
+if curl --version 2> /dev/null > /dev/null
+then
+ echo " OK"
+
+ echo -n "Fetch order list as PDF..."
+ STATUS=$(curl 'http://localhost:9966/instances/test/private/orders' \
-H "Accept: application/pdf" \
-w "%{http_code}" \
-s \
-o "$LAST_RESPONSE")
-if [ "$STATUS" != "200" ]
-then
- cat "$LAST_RESPONSE" >&2
- exit_fail "Expected 200, PDF created. got: $STATUS"
+ if [ "$STATUS" != "200" ]
+ then
+ cat "$LAST_RESPONSE" >&2
+ exit_fail "Expected 200, PDF created. got: $STATUS"
+ fi
+ # To keep PDF
+ # mv $LAST_RESPONSE test.pdf
+ echo "OK"
+else
+ echo " Not found, skipping test"
fi
-# To keep PDF
-# mv $LAST_RESPONSE test.pdf
-echo "OK"
echo -n "Fetch order list as CSV..."
STATUS=$(curl 'http://localhost:9966/instances/test/private/orders' \