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 authored and GitHub committed 2020-09-04 16:49:47 -04:00
1 parent 052f2a5868
commit ab9780d971
1 file changed
+1 -1
+1 -1
View File
@@ -211,7 +211,7 @@ trigger-scheduler-docker-local-check-deploy() {
# shellcheck disable=SC2086 # shellcheck disable=SC2086
if OUTPUT=$(curl -# $CURL_ARGS 2>&1); then if OUTPUT=$(curl -# $CURL_ARGS 2>&1); then
# OUTPUT contains the HTTP response # OUTPUT contains the HTTP response
if [[ "$OUTPUT" =~ $EXPECTED ]]; then if [[ "$OUTPUT" =~ "$EXPECTED" ]]; then
SUCCESS=1 SUCCESS=1
break break
fi fi