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