ci: docDB int test wait for appsmith health before cypress (#26655)

This commit is contained in:
Sumesh Pradhan 2023-08-25 15:27:48 +05:30 committed by GitHub
parent 193f4849a7
commit 1f5223c01d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -331,6 +331,10 @@ jobs:
echo "COMMIT_INFO_MESSAGE=$(echo \"${{ env.EVENT_COMMITS }}\" | awk -F '\\\\n' '{print $1}' | sed 's/^\"//')" >> $GITHUB_ENV echo "COMMIT_INFO_MESSAGE=$(echo \"${{ env.EVENT_COMMITS }}\" | awk -F '\\\\n' '{print $1}' | sed 's/^\"//')" >> $GITHUB_ENV
fi fi
- name: Wait until appsmith server is healthy
run: |
bash scripts/health_check.sh
- name: Run the cypress test - name: Run the cypress test
if: steps.run_result.outputs.run_result != 'success' && steps.run_result.outputs.run_result != 'failedtest' if: steps.run_result.outputs.run_result != 'success' && steps.run_result.outputs.run_result != 'failedtest'
id: cypress_test id: cypress_test

13
scripts/health_check.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/bash
endpoint="http://localhost/api/v1/health"
status_code=0
while [ $status_code -ne 200 ]; do
response=$(curl -s -o /dev/null -w "%{http_code}" "$endpoint")
status_code=$response
if [ $status_code -ne 200 ]; then
echo "Response status code: $status_code. Retrying..."
sleep 30
fi
done