Support for expected text with special characters

Added a quote around the "$EXPECTED" to deal with text with restricted characters. While deploying a Spring Boot application, the content of the built-in health check is {"status":"UP"}. Unfortunately all my checks failed, because for some reason the comparison didn't like this content.

remote:  !     http://localhost/actuator/health: expected to but did not find: "{"status":"UP"}"
remote:  !     Check attempt 7/10 failed.

After making this change, it works: I'm assuming the difference is that the presence of the quote characters in the content.
This commit is contained in:
fomojola
2020-09-04 16:49:47 -04:00
committed by GitHub
parent 052f2a5868
commit ab9780d971

View File

@@ -211,7 +211,7 @@ trigger-scheduler-docker-local-check-deploy() {
# shellcheck disable=SC2086
if OUTPUT=$(curl -# $CURL_ARGS 2>&1); then
# OUTPUT contains the HTTP response
if [[ "$OUTPUT" =~ $EXPECTED ]]; then
if [[ "$OUTPUT" =~ "$EXPECTED" ]]; then
SUCCESS=1
break
fi