Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove authenticated smoketests #2693

Merged
merged 1 commit into from
Mar 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 0 additions & 66 deletions ci/tasks/galoy-smoketest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ source smoketest-settings/helpers.sh
host=$(setting "galoy_endpoint")
port=$(setting "galoy_port")

phone=$(echo "$(setting "test_accounts_list")" | jq -r '.[0].phone')
code=$(echo "$(setting "test_accounts_list")" | jq -r '.[0].code')

admin_endpoint=$(setting "admin_api_endpoint")
admin_phone=$(echo "$(setting "admin_panel_users_list")" | jq -r '.[0].phone')
admin_code=$(echo "$(setting "admin_panel_users_list")" | jq -r '.[0].code')

function break_and_display_on_error_response() {
if [[ $(jq -r '.errors' <./response.json) != "null" ]]; then
echo Smoketest failed! - Response:
Expand All @@ -37,65 +30,6 @@ set -e

break_and_display_on_error_response

# galoy-backend auth
#"url": "<(http|https)>://<[a-zA-Z0-9-.:]+>/graphql<.*>",
#"methods": [ "POST" ]
set +e
for i in {1..15}; do
echo "Attempt ${i} to test login on the galoy-backend"
curl -LksSf "${host}:${port}/graphql" -H 'Content-Type: application/json' \
-H 'Accept: application/json' --data-binary \
"{\"query\":\"mutation login(\$input: UserLoginInput!) { userLogin(input: \$input) { authToken } }\",\"variables\":{\"input\":{\"phone\":\"${phone}\",\"code\":\"${code}\"}}}" \
>response.json
if [[ $? == 0 ]]; then
if grep "null" >/dev/null <response.json; then
cat response.json
if [[ $i -eq 15 ]]; then
echo "Smoketest failed!"
echo "Failed to login after 15 attempts"
exit 1
fi
else
success="true"
break
fi
fi
sleep 1
done
set -e

break_and_display_on_error_response

# admin-backend auth
#"url": "<(http|https)>://<.*><[0-9]*>/admin/<.*>",
#"methods": ["GET", "POST", "OPTIONS"]
set +e
for i in {1..15}; do
echo "Attempt ${i} to test login on the admin-backend"
curl -LksSf "${admin_endpoint}" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' --data-binary \
"{\"query\":\"mutation login(\$input: UserLoginInput!) { userLogin(input: \$input) { authToken } }\",\"variables\":{\"input\":{\"phone\":\"${admin_phone}\",\"code\":\"${admin_code}\"}}}" \
>response.json
if [[ $? == 0 ]]; then
if grep "null" >/dev/null <response.json; then
cat response.json
if [[ $i -eq 15 ]]; then
echo "Smoketest failed!"
echo "Failed to login after 15 attempts"
exit 1
fi
else
success="true"
break
fi
fi
sleep 1
done
set -e

break_and_display_on_error_response

# price history server healthcheck
# The following health.proto file has been copied from
# https://github.com/GaloyMoney/price/blob/main/history/src/servers/protos/health.proto
Expand Down