From ca3d989eaa81c81fa540dc5c06724a547c830395 Mon Sep 17 00:00:00 2001 From: Boban Ljuljdjurovic Date: Wed, 25 Oct 2023 11:12:27 -0400 Subject: [PATCH 1/3] fix e2e --- cypress/e2e.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e.sh b/cypress/e2e.sh index a847e0dd33..2920e0d1fb 100755 --- a/cypress/e2e.sh +++ b/cypress/e2e.sh @@ -79,13 +79,13 @@ echo http_response=0 polls=0 -while [[ $http_response != "200" && $polls -lt 72 ]]; do +while [[ $http_response != *"UP"* && $polls -lt 72 ]]; do ((polls++)) sleep 5 echo "Waiting for backend to start at ${TEST_ENV}${BACKEND_URL_PATH}" http_response=$(curl -skL -w "%{http_code}" "${TEST_ENV}${BACKEND_URL_PATH}") done -if [[ $http_response -ne 200 ]]; then +if [[ $http_response -ne *"UP"* ]]; then echo 'Backend never started. Exiting...' exit 1 fi From b29584241f184816404ba5250f9c7885de4d6308 Mon Sep 17 00:00:00 2001 From: Boban Ljuljdjurovic Date: Wed, 25 Oct 2023 12:08:44 -0400 Subject: [PATCH 2/3] fix lighthouse.sh backend start --- lighthouse.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lighthouse.sh b/lighthouse.sh index c09a224401..0ea0f4b5f8 100755 --- a/lighthouse.sh +++ b/lighthouse.sh @@ -6,13 +6,13 @@ docker compose -f docker-compose.yml -f docker-compose.ci.yml up -d --quiet-pull echo "Waiting for backend to start at https://localhost.simplereport.gov/api/actuator/health" http_response=0 polls=0 -while [[ $http_response != "200" && $polls -lt 180 ]]; do +while [[ $http_response != *"UP"* && $polls -lt 180 ]]; do ((polls++)) sleep 2 echo "Waiting for backend to start at https://localhost.simplereport.gov/api/actuator/health" http_response=$(curl -skL -w "%{http_code}" "https://localhost.simplereport.gov/api/actuator/health") done -if [[ $http_response -ne 200 ]]; then +if [[ $http_response -ne *"UP"* ]]; then echo 'Backend never started. Exiting...' exit 1 fi From da4800fca72c1f072fc6a666308d6ff80a4a5956 Mon Sep 17 00:00:00 2001 From: Boban Ljuljdjurovic Date: Wed, 25 Oct 2023 12:21:55 -0400 Subject: [PATCH 3/3] remove -ne flag form comparison --- cypress/e2e.sh | 2 +- lighthouse.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e.sh b/cypress/e2e.sh index 2920e0d1fb..f80b11c923 100755 --- a/cypress/e2e.sh +++ b/cypress/e2e.sh @@ -85,7 +85,7 @@ while [[ $http_response != *"UP"* && $polls -lt 72 ]]; do echo "Waiting for backend to start at ${TEST_ENV}${BACKEND_URL_PATH}" http_response=$(curl -skL -w "%{http_code}" "${TEST_ENV}${BACKEND_URL_PATH}") done -if [[ $http_response -ne *"UP"* ]]; then +if [[ $http_response != *"UP"* ]]; then echo 'Backend never started. Exiting...' exit 1 fi diff --git a/lighthouse.sh b/lighthouse.sh index 0ea0f4b5f8..bc2c65cfc6 100755 --- a/lighthouse.sh +++ b/lighthouse.sh @@ -12,7 +12,7 @@ while [[ $http_response != *"UP"* && $polls -lt 180 ]]; do echo "Waiting for backend to start at https://localhost.simplereport.gov/api/actuator/health" http_response=$(curl -skL -w "%{http_code}" "https://localhost.simplereport.gov/api/actuator/health") done -if [[ $http_response -ne *"UP"* ]]; then +if [[ $http_response != *"UP"* ]]; then echo 'Backend never started. Exiting...' exit 1 fi