Compare commits
2 Commits
08a5dd0870
...
cd6d21b5f3
Author | SHA1 | Date |
---|---|---|
![]() |
cd6d21b5f3 | |
![]() |
57c6b9606e |
|
@ -1,12 +1,12 @@
|
||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
set -o pipefail
|
|
||||||
set -o errexit
|
set -o errexit
|
||||||
set -o nounset
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
shopt -s inherit_errexit
|
||||||
|
|
||||||
: ${DOMAIN:?specify domain name}
|
: "${DOMAIN:?specify domain name}"
|
||||||
|
readonly AUTH_HEADER="Authorization: Bearer ${API_TOKEN:?not set error}"
|
||||||
readonly AUTH_HEADER="Authorization: Bearer du-dummy-api-token"
|
|
||||||
readonly QUERY='query AllServices {
|
readonly QUERY='query AllServices {
|
||||||
services {
|
services {
|
||||||
allServices {
|
allServices {
|
||||||
|
@ -85,9 +85,11 @@ received_response="$(curl --show-error -s "https://api.$DOMAIN/graphql" \
|
||||||
|
|
||||||
jq <<<"$received_response"
|
jq <<<"$received_response"
|
||||||
|
|
||||||
if [ "$EXPECTED_RESPONSE" == "$received_response" ]; then
|
if diff -w -u --color <(printf "%s\n" "$EXPECTED_RESPONSE") <(printf "%s\n" "$received_response") 2>/dev/null
|
||||||
|
then
|
||||||
echo -e "\e[1;32mOK"
|
echo -e "\e[1;32mOK"
|
||||||
else
|
else
|
||||||
echo -e "\e[1;31mFAIL: response does not match!"
|
echo -e "\e[1;31mFAIL: response does not match!"
|
||||||
|
jd -color <(printf "%s" "$EXPECTED_RESPONSE") <(printf "%s" "$received_response")
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue