From 4614793f08f7fea9e37ab1cc9e575e476b5297ff Mon Sep 17 00:00:00 2001 From: Juan P Lopez Date: Mon, 22 Jan 2024 20:36:04 -0500 Subject: [PATCH] test(pay): update smoketest to include invoice request validation --- ci/tasks/galoy-pay-smoketest.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ci/tasks/galoy-pay-smoketest.sh b/ci/tasks/galoy-pay-smoketest.sh index 63cdd96f85..5e29c74d37 100755 --- a/ci/tasks/galoy-pay-smoketest.sh +++ b/ci/tasks/galoy-pay-smoketest.sh @@ -19,6 +19,7 @@ set +e for host in $(echo $hosts | jq -r '.[]'); do galoy_pay_success="false" lnurlp_endpoint_success="true" + lnurlp_request_invoice_success="true" for i in {1..15}; do echo "Attempt ${i} to curl galoy pay on host ${host}" @@ -30,6 +31,7 @@ for host in $(echo $hosts | jq -r '.[]'); do if [[ "$lnurl_check_disabled" != "true" ]]; then lnurlp_endpoint_success="false" + lnurlp_request_invoice_success="false" for i in {1..15}; do echo "Attempt ${i} to curl lnurlp endpoint on host ${host}" response=$(curl --location -fs ${host}/.well-known/lnurlp/test) @@ -37,9 +39,19 @@ for host in $(echo $hosts | jq -r '.[]'); do if [[ "$is_response_valid" == "true" ]]; then lnurlp_endpoint_success="true"; break; fi; sleep 1 done + + if [[ "$lnurlp_endpoint_success" == "true" ]]; then + for i in {1..15}; do + echo "Attempt ${i} to curl lnurlp endpoint to request an invoice on host ${host}" + response=$(curl --location -fs ${host}/lnurlp/test/callback?amount=1000000) + is_response_valid=$(echo $response | jq -r 'has("pr") and has("routes")') + if [[ "$is_response_valid" == "true" ]]; then lnurlp_request_invoice_success="true"; break; fi; + sleep 1 + done + fi; fi - if [[ "$galoy_pay_success" != "true" || "$lnurlp_endpoint_success" != "true" ]]; then + if [[ "$galoy_pay_success" != "true" || "$lnurlp_endpoint_success" != "true" || "$lnurlp_request_invoice_success" != "true" ]]; then echo "Smoke test failed for host ${host}" exit 1 fi;